mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-02 05:38:02 +00:00
🐛(frontend) fix focus restore for chevron menus
Ensure focus returns to camera chevron after effects panel closes.
This commit is contained in:
+1
@@ -152,6 +152,7 @@ export const VideoDeviceControl = ({
|
|||||||
</Button>
|
</Button>
|
||||||
{({ close }) => (
|
{({ close }) => (
|
||||||
<div
|
<div
|
||||||
|
data-attr="camera-menu-popover"
|
||||||
className={css({
|
className={css({
|
||||||
maxWidth: '36rem',
|
maxWidth: '36rem',
|
||||||
padding: '0.15rem',
|
padding: '0.15rem',
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ export const Effects = () => {
|
|||||||
if (activeEl?.tagName === 'DIV') {
|
if (activeEl?.tagName === 'DIV') {
|
||||||
return getTrigger('options') ?? activeEl
|
return getTrigger('options') ?? activeEl
|
||||||
}
|
}
|
||||||
|
if (activeEl?.closest('[data-attr="camera-menu-popover"]')) {
|
||||||
|
return getTrigger('cameraMenu') ?? activeEl
|
||||||
|
}
|
||||||
// For direct button clicks, use the active element as is
|
// For direct button clicks, use the active element as is
|
||||||
return activeEl
|
return activeEl
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,6 +30,12 @@ export const useSidePanel = () => {
|
|||||||
return layoutStore.sidePanelTriggers.options ?? activeEl
|
return layoutStore.sidePanelTriggers.options ?? activeEl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
panelId === PanelId.EFFECTS &&
|
||||||
|
activeEl?.closest('[data-attr="camera-menu-popover"]')
|
||||||
|
) {
|
||||||
|
return layoutStore.sidePanelTriggers.cameraMenu ?? activeEl
|
||||||
|
}
|
||||||
const triggerKeyByPanel: Partial<Record<PanelId, SidePanelTriggerKey>> = {
|
const triggerKeyByPanel: Partial<Record<PanelId, SidePanelTriggerKey>> = {
|
||||||
[PanelId.PARTICIPANTS]: 'participants',
|
[PanelId.PARTICIPANTS]: 'participants',
|
||||||
[PanelId.TOOLS]: 'tools',
|
[PanelId.TOOLS]: 'tools',
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ export const Popover = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!effectiveOpen || !focusOnOpen) return
|
const wasOpen = prevOpenRef.current
|
||||||
|
if (wasOpen || !effectiveOpen || !focusOnOpen) return
|
||||||
const first = popoverContentRef.current?.querySelector<HTMLElement>(
|
const first = popoverContentRef.current?.querySelector<HTMLElement>(
|
||||||
focusOnOpen.selector
|
focusOnOpen.selector
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user