-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fix(item): only add click events to clickable items #22352
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in a couple different apps. Does not break anything that I have found.
I was not able to test in NVDA to see if it fixed the issue there, but had no issues in the apps I tried it in.
LGTM, I am fine with merging it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern about this is that we are making the click handler not reactive. If an item loads with no inputs then adds an input after a delay, this delegatesFocus function will never fire.
I can't imagine this is a common use case, but this PR would break that behavior.
I fixed Liam's concerns with adding an input later on. The event listener is now added in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the removeEventListener change we talked about offline, this looks good to go
…team#22352) This stops screen readers, such as NVDA, from reading every item as clickable even when it is text only. fixes ionic-team#22011
Dev build:
5.5.0-dev.202010301640.9336349
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: fixes #22011
What is the new behavior?
Correctly announce items for screen readers, don't announce clickable when it is not
Does this introduce a breaking change?
Other information