eps1lon / dom-accessibility-api

Implements https://w3c.github.io/accname/
MIT License
100 stars 29 forks source link

WIP: fix: omit blanket trimming of accumulatedText #971

Open neaumusic opened 1 year ago

neaumusic commented 1 year ago

This is just a work in progress to get some feedback, it would probably be good to add tests for this case.

I've had this issue for a while, and I spend the day investigating a gmail 'recipient grid row'

Screenshot 2023-07-17 at 7 19 22 PM

In gmail, the recipients involved includes a node which has a comma and a space after it.

When computing the label using this package, I was getting Sydney,me 2 rather than Sydney, me 2

This issue of missing spaces has surfaced across many, many websites, and is ultimately the reason why I don't trust the package in most cases (it's an incredible fallback though).


I believe this line is the root cause, and I'm thinking the trim() only exists for the afterContent append.

I linked this package into ours and this fix instantly resolved the issue, so I'm probably biased, but it would be great if @eps1lon looked into this; the gmail is an easy repro

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 4748ebdcf7861f836644d37b3e2802836d9b9dd1

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

neaumusic commented 1 year ago

Awesome, yea I agree on testing!

Didn't close it for any particular reason; we are using this modified version