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

Modify merge_aria to combine plural attributes; introduce merge_data #1895

Merged
merged 3 commits into from
Mar 22, 2023

Conversation

camertron
Copy link
Contributor

Description

We've had a #merge_aria method for a little while now that handles merging aria attributes from system arguments. The problem is a bit tricky because aria attributes can be passed as a hash with an aria: key (eg. aria: { foo: "bar" }) or as individual key/value pairs (eg. "aria-foo": "bar").

I had a need today to handle so-called "plural" aria attributes like aria-describedby and aria-labelledby, which support multiple space-delimited values, eg. aria-labelledby="foo bar". I also wanted to handle data attributes.

I will submit another PR soon that actually uses these methods.

Integration

Does this change require any updates to code in production?

No

Merge checklist

  • Added/updated tests
  • Added/updated documentation
    - [ ] Added/updated previews

@changeset-bot
Copy link

changeset-bot bot commented Mar 21, 2023

🦋 Changeset detected

Latest commit: b8c7be7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the ruby Pull requests that update Ruby code label Mar 21, 2023
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Nice, I didn't realize labelledby could have multiple arguments.

@camertron camertron merged commit e53f199 into main Mar 22, 2023
@camertron camertron deleted the merge_aria_data branch March 22, 2023 17:44
@primer-css primer-css mentioned this pull request Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch release ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants