Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

πŸ›(frontend) use state instead of a ref for MoreControls container

lebaudantoine15ca2b41b4af
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c6b955b6..2d08eb06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ and this project adheres to
- ⬆️(backend) bump sqlparse from 0.5.5 to 0.6.0
- ⬆️(mail) bump @html-to/text-cli from 0.6.0 to 0.6.1
- πŸ›(frontend) treat client-initiated connect aborts as events
+- πŸ›(frontend) use state instead of a ref for MoreControls container
## [1.27.0] - 2026-08-14
diff --git a/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/DesktopControlBar.tsx b/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/DesktopControlBar.tsx
index 975b8338..fe2d70a4 100644
--- a/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/DesktopControlBar.tsx
+++ b/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/DesktopControlBar.tsx
@@ -9,7 +9,7 @@ import { SubtitlesToggle } from '../../components/controls/SubtitlesToggle'
import { OptionsButton } from '../../components/controls/Options/OptionsButton'
import { StartMediaButton } from '../../components/controls/StartMediaButton'
import { MoreOptions } from './MoreOptions'
-import { useRef } from 'react'
+import { RefObject, useMemo, useState } from 'react'
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
import { useFullScreen } from '../../hooks/useFullScreen'
import { VideoDeviceControl } from '../../components/controls/Device/VideoDeviceControl'
@@ -21,7 +21,14 @@ export function DesktopControlBar({
onDeviceError,
}: Readonly<ControlBarAuxProps>) {
const browserSupportsScreenSharing = supportsScreenSharing()
- const desktopControlBarEl = useRef<HTMLDivElement>(null)
+
+ const [controlBarElement, setControlBarElement] =
+ useState<HTMLDivElement | null>(null)
+
+ const desktopControlBarEl = useMemo<RefObject<HTMLDivElement>>(
+ () => ({ current: controlBarElement }),
+ [controlBarElement]
+ )
const { toggleFullScreen, isFullscreenAvailable } = useFullScreen({})
@@ -45,7 +52,7 @@ export function DesktopControlBar({
return (
<div
- ref={desktopControlBarEl}
+ ref={setControlBarElement}
className={css({
width: '100vw',
display: 'flex',