mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-24 08:56:28 +00:00
🐛(frontend) use state instead of a ref for MoreControls container
After the recent refactoring, `MoreControls` only renders once. On that first render, the container ref is `null`, and when it later gets a reference to the div, the ref update does not trigger a re-render. As a result, the additional controls were never showing up. Switch from a ref to a state to track the container element. State updates do trigger a re-render, so the controls now show as expected once the container is available.
This commit is contained in:
@@ -22,6 +22,7 @@ and this project adheres to
|
|||||||
- ⬆️(backend) bump sqlparse from 0.5.5 to 0.6.0
|
- ⬆️(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
|
- ⬆️(mail) bump @html-to/text-cli from 0.6.0 to 0.6.1
|
||||||
- 🐛(frontend) treat client-initiated connect aborts as events
|
- 🐛(frontend) treat client-initiated connect aborts as events
|
||||||
|
- 🐛(frontend) use state instead of a ref for MoreControls container
|
||||||
|
|
||||||
## [1.27.0] - 2026-08-14
|
## [1.27.0] - 2026-08-14
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { SubtitlesToggle } from '../../components/controls/SubtitlesToggle'
|
|||||||
import { OptionsButton } from '../../components/controls/Options/OptionsButton'
|
import { OptionsButton } from '../../components/controls/Options/OptionsButton'
|
||||||
import { StartMediaButton } from '../../components/controls/StartMediaButton'
|
import { StartMediaButton } from '../../components/controls/StartMediaButton'
|
||||||
import { MoreOptions } from './MoreOptions'
|
import { MoreOptions } from './MoreOptions'
|
||||||
import { useRef } from 'react'
|
import { RefObject, useMemo, useState } from 'react'
|
||||||
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
|
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
|
||||||
import { useFullScreen } from '../../hooks/useFullScreen'
|
import { useFullScreen } from '../../hooks/useFullScreen'
|
||||||
import { VideoDeviceControl } from '../../components/controls/Device/VideoDeviceControl'
|
import { VideoDeviceControl } from '../../components/controls/Device/VideoDeviceControl'
|
||||||
@@ -21,7 +21,14 @@ export function DesktopControlBar({
|
|||||||
onDeviceError,
|
onDeviceError,
|
||||||
}: Readonly<ControlBarAuxProps>) {
|
}: Readonly<ControlBarAuxProps>) {
|
||||||
const browserSupportsScreenSharing = supportsScreenSharing()
|
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({})
|
const { toggleFullScreen, isFullscreenAvailable } = useFullScreen({})
|
||||||
|
|
||||||
@@ -45,7 +52,7 @@ export function DesktopControlBar({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={desktopControlBarEl}
|
ref={setControlBarElement}
|
||||||
className={css({
|
className={css({
|
||||||
width: '100vw',
|
width: '100vw',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
Reference in New Issue
Block a user