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

refactor(delay): update how LiveRegionElement throttles announcements for better ordering of announcements #41

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

joshblack
Copy link
Member

@joshblack joshblack commented Apr 2, 2024

Changelog

New

Changed

  • Change waitMs option in constructor to a delay attribute on the custom element
  • Change how updateContainerWithMessage is throttled. Instead of keeping a separate queue of messages to be announced, we now have a pending state in the live region. This makes it so that we still only announce once every delay but the ordering of messages is improved by making sure "immediate" ones are announced sooner than if they were added to the back of the throttle queue

Removed

Testing & Reviewing

Copy link

changeset-bot bot commented Apr 2, 2024

🦋 Changeset detected

Latest commit: d185fef

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

This PR includes changesets to release 1 package
Name Type
@primer/live-region-element Minor

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

@joshblack joshblack merged commit a20aa47 into main Apr 2, 2024
6 checks passed
@joshblack joshblack deleted the refactor/update-throttle-queue branch April 2, 2024 16:00
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.

1 participant