feat: focus search input on opening sidebar

This commit is contained in:
EnixCoda 2018-10-17 22:46:15 +08:00
parent 1dce80d78e
commit b663ca052a
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -93,7 +93,7 @@ const onKeyDown = dispatch => e => {
const toggleShowSideBar = dispatch => () => dispatch(({ shouldShow }) => dispatch(setShouldShow, !shouldShow))
const setShouldShow = dispatch => shouldShow => {
dispatch({ shouldShow })
dispatch({ shouldShow }, shouldShow ? DOMHelper.focusSearchInput : null)
DOMHelper.setBodyIndent(shouldShow)
}