mirror of
https://github.com/Alamantus/Lexiconga.git
synced 2025-03-25 12:50:45 +01:00
Focus search box when opening search header
This commit is contained in:
parent
b8354a3ae5
commit
b5d57393c2
1 changed files with 9 additions and 0 deletions
|
@ -18,6 +18,12 @@ export class SearchBox extends Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (this.state.showHeader && this.searchBox) {
|
||||
this.searchBox.focus();
|
||||
}
|
||||
}
|
||||
|
||||
search () {
|
||||
const {searchingIn, searchTerm, filteredPartsOfSpeech} = this.state;
|
||||
const searchConfig = {
|
||||
|
@ -57,6 +63,9 @@ export class SearchBox extends Component {
|
|||
</p>
|
||||
<p className='control is-expanded'>
|
||||
<input className='input' type='text' placeholder='Search Term'
|
||||
ref={input => {
|
||||
this.searchBox = input;
|
||||
}}
|
||||
value={this.state.searchTerm}
|
||||
onChange={event => {
|
||||
console.log(event);
|
||||
|
|
Loading…
Add table
Reference in a new issue