dom-accessibility-api icon indicating copy to clipboard operation
dom-accessibility-api copied to clipboard

fix: handle detached nodes for accessible descriptions

Open jlp-craigmorten opened this issue 1 year ago • 1 comments

Fixes #1026

Updates the computeAccessibleDescription() method to handle computation of an accessible description for an element that has not been added to the document.


In this fix I have opted to use the querySelector() approach, using a polyfill of CSS.escape() to handle special characters in the element's id (e.g. see React.useId()). There may be other valid approaches that are less involved and more performant.

The fix is applied to the queryIdRefs() utility, and so also impacts other usage such as aria-owns and aria-labelledby evaluation.

jlp-craigmorten avatar Feb 08 '24 13:02 jlp-craigmorten

⚠️ No Changeset found

Latest commit: 5d373cd8ad6ebe139703ddfd2fda1058efa2be0b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

changeset-bot[bot] avatar Feb 08 '24 13:02 changeset-bot[bot]