-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add modal button aria label and export ModalCloseButton #550
Conversation
@@ -74,6 +75,7 @@ const Modal = forwardRef<HTMLDivElement, ModalProps>(function ModalInner( | |||
onClose, | |||
className, | |||
isOpen = false, | |||
closeButtonAriaLabel = 'Close', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a prop for i18n
@@ -224,7 +228,7 @@ const ModalBackground = animated(styled.div<{ | |||
} | |||
`) | |||
|
|||
const ModalCrossButton = styled(IconButton)` | |||
export const ModalCloseButton = styled(IconButton)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case user want to set isDismissable
to false and handle it themselves, for example, pass different onClose
for close button and background.
@@ -36,7 +36,7 @@ const IconButton = forwardRef<ClickableElement, IconButtonProps>( | |||
$variant={variant} | |||
$isActive={isActive} | |||
> | |||
<pixiv-icon name={icon} /> | |||
<pixiv-icon aria-hidden="true" name={icon} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes all IconButton
s. If it's too broad to decide I'll make this a separate PR.
e4d7a5a
to
02037a7
Compare
やったこと
closeButtonAriaLabel
forModal
andaria-hidden
for pixiv-icon inside.ModalCloseButton
Before:
After:
動作確認環境
チェックリスト
不要なチェック項目は消して構いません