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

fix(item): only add click events to clickable items #22352

Merged
merged 11 commits into from
Nov 4, 2020

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Oct 19, 2020

Dev build: 5.5.0-dev.202010301640.9336349

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

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?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Oct 19, 2020
Copy link
Member

@kensodemann kensodemann left a 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.

Copy link
Contributor

@liamdebeasi liamdebeasi left a 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.

@github-actions github-actions bot added the package: react @ionic/react package label Oct 30, 2020
@brandyscarney
Copy link
Member Author

I fixed Liam's concerns with adding an input later on. The event listener is now added in the componentDidUpdate only if it has not already been added. Dev build for testing 5.5.0-dev.202010301640.9336349. We need to test out that it doesn't break the fix for #21509.

Copy link
Contributor

@liamdebeasi liamdebeasi left a 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

@brandyscarney brandyscarney merged commit 9659ad6 into master Nov 4, 2020
@brandyscarney brandyscarney deleted the fix-item-clickable-a11y branch November 4, 2020 21:19
TakumaKira pushed a commit to TakumaKira/ionic-framework that referenced this pull request Nov 13, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package package: react @ionic/react package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: ion-item being read as clickable by screen reader
3 participants