mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-04 17:07:22 +00:00
InputBox: focus on fullscreen enter
This commit is contained in:
parent
759d221c40
commit
cce894176f
1 changed files with 8 additions and 1 deletions
|
|
@ -60,8 +60,15 @@ export default function InputBox ({
|
|||
const inputEl = useRef(null)
|
||||
|
||||
useEffect(() => {
|
||||
setInputText('')
|
||||
let setFocus = () => {
|
||||
inputEl.current && inputEl.current.focus()
|
||||
}
|
||||
|
||||
setInputText('')
|
||||
setFocus()
|
||||
|
||||
document.addEventListener('fullscreenchange', setFocus)
|
||||
return () => document.removeEventListener('fullscreenchange', setFocus)
|
||||
}, [inputType])
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue