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

used requestAnimationFrame and preventScroll to preserve smooth transition

Signed-off-by: Cyril <[email protected]>
This commit is contained in:
lebaudantoine
2026-01-06 23:35:07 +01:00
parent a4fc63b68c
commit f602fe3905
@@ -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()