fix: avoid page scrolling when treeSelect is first opened
parent
793a5ac97e
commit
31862e1112
|
@ -70,11 +70,12 @@ const SearchInput = {
|
||||||
*/
|
*/
|
||||||
focus (isDidMount) {
|
focus (isDidMount) {
|
||||||
if (this.inputRef.current) {
|
if (this.inputRef.current) {
|
||||||
this.inputRef.current.focus()
|
|
||||||
if (isDidMount) {
|
if (isDidMount) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.inputRef.current.focus()
|
this.inputRef.current.focus()
|
||||||
}, 0)
|
}, 0)
|
||||||
|
} else { // set it into else, Avoid scrolling when focus
|
||||||
|
this.inputRef.current.focus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue