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

NgbRadioGroup keyboard navigation shouldn't go to the next radio group #1704

Closed
jnizet opened this issue Jul 26, 2017 · 2 comments
Closed

NgbRadioGroup keyboard navigation shouldn't go to the next radio group #1704

jnizet opened this issue Jul 26, 2017 · 2 comments

Comments

@jnizet
Copy link
Member

jnizet commented Jul 26, 2017

Bug description:

When there are several groups of radio buttons (using ngbRadioGroup) on the same page, navigating with the keyboard from radio to radio, using arrow keys, should keep the focus in the same group and cycle. Instead, the focus jumps from the last radio of the group to the first radio of the next group, which is quite surprising.

The issue can be fixed by specifying a name on the input elements of the group, but

  • the ng-bootstrap demo doesn't do that; so if it's needed, the demo should be fixed
  • it feels redundant to specify a name on the inputs when we have already specified one on the ngbRadioGroup. Maybe the directive should add the name attribute to the inputs.

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/QQyl35agwv4DM8FB7DZD?p=preview

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 4.3.1

ng-bootstrap: 1.0.0-alpha.29

Bootstrap: 4.0.0-alpha.6

@pkozlowski-opensource
Copy link
Member

Good catch @jnizet !

Now that we've got a directive specifically targeting input elements (https://ng-bootstrap.github.io/#/components/buttons/api#NgbRadio) we could indeed generate names.

How about this: we add a new name @Input() and if none is provided we generate names (similarly to what we do with ids in several places). Fancy a PR?

@jnizet
Copy link
Member Author

jnizet commented Jul 26, 2017

I'll try doing that.

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

Successfully merging a pull request may close this issue.

2 participants