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(input): check for tabindex and pass it properly to native input #21170

Merged
merged 5 commits into from
May 13, 2020

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Apr 30, 2020

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 #17515

Dev build: 5.1.0-dev.202005041740.7d6b4b5

What is the new behavior?

This is not the best code ever written, but it does work. I can't think of a way to ignore tabindex on the main host element without removing it after passing it down. Open for review.

  • Check if input has a tabindex attribute, pass it down if so and then remove it
  • Makes it so the ion-input is ignored from being tabbed to, but the native input can still be tabbed to
  • Delegates focus on the item to the input, can set tabindex on ion-item and it will pass down to the input in Chrome and Safari ignoring the focus on the item, in Firefox it will tab to the item then the input

Does this introduce a breaking change?

  • Yes
  • No

To test this PR, install based on the project type

# angular project
npm i @ionic/[email protected]

# core / vanilla JS project
npm i @ionic/[email protected]

# react project
npm i @ionic/[email protected]

@ionitron-bot ionitron-bot bot added the package: core @ionic/core package label Apr 30, 2020
@brandyscarney brandyscarney merged commit dd4cb70 into master May 13, 2020
@brandyscarney brandyscarney deleted the fix-input-tabindex branch May 13, 2020 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Accessibility] ion-input tabindex cross-browser difference
1 participant