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

Tabindex works in an unwanted behaviour #1175

Closed
sp90 opened this issue May 20, 2019 · 0 comments
Closed

Tabindex works in an unwanted behaviour #1175

sp90 opened this issue May 20, 2019 · 0 comments

Comments

@sp90
Copy link

sp90 commented May 20, 2019

Describe the bug
When trying to use tabindex and set on the component like this:

<ng-select tabindex="1"></ng-select>

Then the tabindex is set both on the input field and the component which makes it show when you tab

Reproducbile example
Example which reproduces described behaviour

To Reproduce
Steps to reproduce the behavior (if example is not provided):

  1. Click on the stackblitz example
  2. Try to tab (then it focuses the wrapper) *ERROR
  3. Tab again to target the input

Expected behavior
It should only focus the input

Screenshots
Screenshot 2019-05-20 at 09 20 43

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version 74.0.3729.131

Smartphone (please complete the following information):
Not tested on a smart phone (can you tab on a smart phone)

Additional context
You might resolve this by renaming the tabindex input on the parent to tabIndex.

A hack until this is resolved is to use this:

<ng-select tabindex="1" [attr.tabindex]="-1"></ng-select>

This sets the tabindex on the child and then overwrites the components tabindex on init with the -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant