mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17: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)
|
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(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue