Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
988318a5
Commit
988318a5
authored
Mar 10, 2018
by
Andrew Hrdy
Browse files
Focus input on search (mobile)
Closes
#37
parent
ae70a19f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/containers/SearchBar.js
View file @
988318a5
...
...
@@ -61,7 +61,12 @@ class SearchBar extends React.Component {
this
.
props
.
onSearchExpand
();
this
.
inputElement
.
focus
();
/*
This timeout is necessary because inputElement is not displayed when execution reaches this point.
By using setTimeout with no delay, inputElement.focus() is added to the end of the execution stack, therefore
being executed after the input is visible.,
*/
setTimeout
(()
=>
this
.
inputElement
.
focus
());
};
handleMobileCollapse
=
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment