Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerJDev committed Sep 20, 2024
1 parent d5b5ec9 commit 67d1e54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/react/src/Overlay/Overlay.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
"defaultValue": "",
"description": "If defined, Overlays will be rendered in the named portal. See also `Portal`."
},
{
"name": "focusTrap",
"type": "string",
"defaultValue": "true",
"description": "Determines if the `Overlay` recieves a focus trap or not"
},
{
"name": "sx",
"type": "SystemStyleObject"
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/Overlay/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ const Overlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
// To be backwards compatible with the old Overlay, we need to set the left prop if x-position is not specified
const leftPosition: React.CSSProperties = left === undefined && right === undefined ? {left: 0} : {left}

const dialog = role && role !== 'dialog' ? true : false
const nonDialog = role && role !== 'dialog' ? true : false

useFocusTrap({
containerRef: overlayRef,
disabled: !focusTrap || dialog,
disabled: !focusTrap || nonDialog,
})

return (
Expand All @@ -217,7 +217,7 @@ const Overlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
height={height}
width={width}
role={role || 'dialog'}
aria-modal={dialog ? undefined : 'true'}
aria-modal={nonDialog ? undefined : 'true'}
{...rest}
ref={overlayRef}
style={
Expand Down

0 comments on commit 67d1e54

Please sign in to comment.