Skip to content

Commit

Permalink
fix: add aria-modal (#143)
Browse files Browse the repository at this point in the history
* fix: add aria-modal

* fix: add ariaModal prop
  • Loading branch information
cliu02 authored Jan 4, 2024
1 parent 1a1f504 commit 1b3e546
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/overlays/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const Modal = (props: ModalProps) => {
<Overlay
ariaLabelledBy={uniqueIdRef.current}
ariaDescription={props.ariaDescription}
ariaModal={true}
open={props.open}
onClose={props.onClose}
className={props.className}
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type OverlayProps = {
open?: boolean
ariaLabelledBy?: string
ariaDescription?: string
ariaModal?: boolean
className?: string
backdrop?: boolean
onClose?: () => void
Expand All @@ -36,6 +37,7 @@ const OverlayInner = (props: OverlayProps) => {
role={props.role}
aria-labelledby={props.ariaLabelledBy}
aria-describedby={props.ariaDescription}
aria-modal={props.ariaModal}
onClick={(e) => {
if (e.target === e.currentTarget) closeHandler()
}}
Expand Down

0 comments on commit 1b3e546

Please sign in to comment.