mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
Improve focus management for AxoContextMenu
This commit is contained in:
@@ -232,6 +232,7 @@ export namespace AxoContextMenu {
|
||||
* Uses a portal to render the content part into the `body`.
|
||||
*/
|
||||
export const Content: FC<ContentProps> = memo(props => {
|
||||
const { open } = useStrictContext(RootContext);
|
||||
return (
|
||||
<ContextMenu.Portal>
|
||||
<ContextMenu.Content
|
||||
@@ -239,6 +240,8 @@ export namespace AxoContextMenu {
|
||||
alignOffset={-6}
|
||||
collisionPadding={6}
|
||||
onCloseAutoFocus={props.onCloseAutoFocus}
|
||||
// @ts-expect-error -- React/TS doesn't know about inert
|
||||
inert={open ? undefined : 'true'}
|
||||
>
|
||||
{props.children}
|
||||
</ContextMenu.Content>
|
||||
|
||||
Reference in New Issue
Block a user