From c17b193ca1e889427f41a1612cbb4756df39b6e4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 24 Nov 2023 22:39:42 -0600 Subject: [PATCH] Gameboy: focus the div after entering fullscreen --- src/components/gameboy.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/gameboy.tsx b/src/components/gameboy.tsx index d5e371e4dc..457aeb74cf 100644 --- a/src/components/gameboy.tsx +++ b/src/components/gameboy.tsx @@ -95,11 +95,17 @@ const Gameboy: React.FC = ({ className, src, aspect = 'normal', onFocu }; }, []); + useEffect(() => { + if (fullscreen) { + node.current?.focus(); + } + }, [fullscreen]); + return (