Skip to content

Commit

Permalink
refactor(CModal): improve accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mrholek committed Sep 9, 2023
1 parent d0fdf04 commit 74c6b24
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/coreui-react/src/components/modal/CModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
className,
)}
tabIndex={-1}
{...(_visible ? { 'aria-modal': true } : { 'aria-hidden': 'true' })}
role="dialog"
{...(_visible
? { 'aria-modal': true, role: 'dialog' }
: { 'aria-hidden': 'true' })}
style={{
...(state !== 'exited' && { display: 'block' }),
}}
Expand All @@ -253,9 +254,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
scrollable={scrollable}
size={size}
>
<CModalContent ref={modalContentRef}>
{children}
</CModalContent>
<CModalContent ref={modalContentRef}>{children}</CModalContent>
</CModalDialog>
</div>
</CModalContext.Provider>
Expand Down

0 comments on commit 74c6b24

Please sign in to comment.