Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

[SG-36350] Accessibility: Global Menu: Focus isn't correctly captured when menus are opened #36915

Merged
merged 9 commits into from
Jul 4, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,4 @@ describe('DashboardsContent', () => {

await waitFor(() => sinon.assert.calledOnce(mockCopyURL))
})
})
});
2 changes: 1 addition & 1 deletion client/wildcard/src/components/Menu/MenuList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ const Popover = React.forwardRef(({ popoverPosition, ...props }, reference) => (
className={classNames('py-1', props.className)}
keepInDOM={true}
/>
)) as ForwardReferenceComponent<'div', PopoverProps>
)) as ForwardReferenceComponent<'div', PopoverProps>;
2 changes: 2 additions & 0 deletions client/wildcard/src/components/Popover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,5 @@ enum Strategy {
```

- **_targetPadding_** (optional) - Adds space/padding between target and popover elements

- **_keepInDOM_** (optional) - By default `PopoverContent` element is removed from DOM when tooltip is hidden. If it's `true`, `PopoverContent` element will be kept in DOM but is hidden with CSS rule `visibility=hidden`. This prop is useful when `PopoverContent` children need this behavior to work. Ex: `@sourcegraph/wildcard` `MenuList` component need this to fix [focus state issue](https://github.com/sourcegraph/sourcegraph/issues/36350).
gitstart-sourcegraph marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ export const FloatingPanel = forwardRef((props, reference) => {
</Component>,
rootRender ?? document.body
)
}) as ForwardReferenceComponent<'div', PropsWithChildren<FloatingPanelProps>>
}) as ForwardReferenceComponent<'div', PropsWithChildren<FloatingPanelProps>>;
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ export const PopoverContent = forwardRef((props, reference) => {
)}
</FloatingPanel>
)
}) as ForwardReferenceComponent<'div', PopoverContentProps>
}) as ForwardReferenceComponent<'div', PopoverContentProps>;