InputBox: focus on fullscreen enter

This commit is contained in:
He4eT 2023-06-04 02:27:21 +03:00 committed by Alexey
commit cce894176f

View file

@ -60,8 +60,15 @@ export default function InputBox ({
const inputEl = useRef(null) const inputEl = useRef(null)
useEffect(() => { useEffect(() => {
setInputText('') let setFocus = () => {
inputEl.current && inputEl.current.focus() inputEl.current && inputEl.current.focus()
}
setInputText('')
setFocus()
document.addEventListener('fullscreenchange', setFocus)
return () => document.removeEventListener('fullscreenchange', setFocus)
}, [inputType]) }, [inputType])
useEffect(() => { useEffect(() => {