Browse Source

fix:点击搜索不会聚焦的bug (#10005)

state变化会有延时,这个判断没用,删掉
pull/10036/head
Water.Li 4 years ago
committed by GitHub
parent
commit
dab9fd9cf1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/components/HeaderSearch/index.tsx

2
src/components/HeaderSearch/index.tsx

@ -51,7 +51,7 @@ const HeaderSearch: React.FC<HeaderSearchProps> = (props) => {
className={classNames(className, styles.headerSearch)}
onClick={() => {
setSearchMode(true);
if (searchMode && inputRef.current) {
if (inputRef.current) {
inputRef.current.focus();
}
}}

Loading…
Cancel
Save