Skip to content
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(modal): support alertdialog aria role #273

Merged
merged 2 commits into from
Sep 22, 2020
Merged

feat(modal): support alertdialog aria role #273

merged 2 commits into from
Sep 22, 2020

Conversation

josefaidt
Copy link
Contributor

fixes #272

Description

Adds alert dialog support for default modal as defined in referenced commit.

  • adds alert boolean prop to component and story
  • adds modalBodyId reactive statement
  • adds alertDialogProps with reactive conditional assignment
let alertDialogProps = {};
$: if (alert) {
  if (passiveModal) {
    alertDialogProps.role = "alert";
  } else if (!passiveModal) {
    alertDialogProps.role = "alertdialog";
    alertDialogProps["aria-describedby"] = modalBodyId;
  }
}

@josefaidt josefaidt requested a review from metonym September 22, 2020 14:58
@josefaidt
Copy link
Contributor Author

@metonym would you prefer the reactive conditional look like this? After posting what I had written I feel this may be more appropriate and readable

let alertDialogProps = {};
$: if (alert) {
  if (passiveModal) {
    alertDialogProps.role = "alert";
  }
  if (!passiveModal) {
    alertDialogProps.role = "alertdialog";
    alertDialogProps["aria-describedby"] = modalBodyId;
  }
}

@metonym
Copy link
Collaborator

metonym commented Sep 22, 2020

@josefaidt let's go with the second one

Copy link
Collaborator

@metonym metonym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this!

@metonym metonym merged commit 6cceca6 into carbon-design-system:master Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[10.17]: feat(modal): support alertdialog aria role
2 participants