diff --git a/.gitignore b/.gitignore index 47e4c79e6..32f3b4421 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,6 @@ output/* _start _temp_*/**/* -src/.idea/ +## Merge any idea folder +*/**/.idea +*.iml diff --git a/frontend/.editorconfig b/frontend/.editorconfig new file mode 100644 index 000000000..c14ef65ef --- /dev/null +++ b/frontend/.editorconfig @@ -0,0 +1,6 @@ +[*] +insert_final_newline = true + +[*.{js,css}] +indent_style = space +indent_size = 2 diff --git a/frontend/src/Artist/Index/Table/ArtistIndexTable.js b/frontend/src/Artist/Index/Table/ArtistIndexTable.js index d49e3a3b9..e4ee39d39 100644 --- a/frontend/src/Artist/Index/Table/ArtistIndexTable.js +++ b/frontend/src/Artist/Index/Table/ArtistIndexTable.js @@ -9,10 +9,22 @@ import ArtistIndexRow from './ArtistIndexRow'; import styles from './ArtistIndexTable.css'; class ArtistIndexTable extends Component { + constructor(props, context) { + super(props, context); + this._table = null; + } // // Control + /** + * Sets the reference to the virtual table + * @param ref + */ + setTableRef = (ref) => { + this._table = ref; + }; + scrollToFirstCharacter(character) { const items = this.props.items; @@ -74,6 +86,7 @@ class ArtistIndexTable extends Component { return ( { + if (!newValue) { + return; + } + this.setState({ value: newValue }); } onKeyDown = (event) => { - if (event.key !== 'Tab' && event.key !== 'Enter') { + if (event.key !== 'Tab' && event.key !== 'Enter' || event.key !== 'ArrowDown' || event.key !== 'ArrowUp') { return; } @@ -110,7 +114,7 @@ class ArtistSearchInput extends Component { highlightedSuggestionIndex } = this._autosuggest.state; - if (!suggestions.length || highlightedSectionIndex) { + if (!suggestions.length || highlightedSectionIndex && (event.key !== 'ArrowDown' || event.key !== 'ArrowUp')) { this.props.onGoToAddNewArtist(value); this._autosuggest.input.blur(); @@ -120,7 +124,7 @@ class ArtistSearchInput extends Component { // If an suggestion is not selected go to the first artist, // otherwise go to the selected artist. - if (highlightedSuggestionIndex == null) { + if (highlightedSuggestionIndex == null && (event.key !== 'ArrowDown' || event.key !== 'ArrowUp')) { this.goToArtist(suggestions[0]); } else { this.goToArtist(suggestions[highlightedSuggestionIndex]);