️(frontend) fix jump and animation break on panel open with auto-focus

used requestAnimationFrame and preventScroll to preserve smooth transition

Signed-off-by: Cyril <c.gromoff@gmail.com>
This commit is contained in:
lebaudantoine
2026-01-06 23:30:21 +01:00
committed by aleb_the_flash
parent 865acf2838
commit fed05f2396

View File

@@ -46,7 +46,11 @@ export const ControlsButton = ({
const primaryActionRef = useRef<HTMLButtonElement | null>(null)
useEffect(() => {
primaryActionRef.current?.focus()
requestAnimationFrame(() => {
if (primaryActionRef.current) {
primaryActionRef.current.focus({ preventScroll: true })
}
})
}, [])
const room = useRoomContext()