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

Dropdown triggering element loses focus when opening/closing #3141

Open
maxokorokov opened this issue Apr 25, 2019 · 0 comments
Open

Dropdown triggering element loses focus when opening/closing #3141

maxokorokov opened this issue Apr 25, 2019 · 0 comments

Comments

@maxokorokov
Copy link
Member

Bug description:

Triggering element should become/stay focused in the following cases:

  1. after dropdown menu is opened on triggering element click
  2. after dropdown menu is closed on triggering element click
  3. after dropdown menu is closed on ESC press

Everything is broken except for 1 and 2 that work only in Chrome.

Link to minimally-working StackBlitz that reproduces the issue:

Stackblitz with both ng-bootstrap and bootstrap dropdowns to compare:

https://stackblitz.com/edit/angular-uahpzh?file=index.html

To reproduce:

  1. Focus lost after opening:
  • Click on ng-bootstrap button
  • ng-bootstrap button should be focused, but it's not (ex. in Safari/Firefox)
  1. Focus lost after closing on click:
  • Focus ng-bootstrap button with keyboard
  • Press ArrowDown to open menu
  • Click on ng-bootstrap button to close the popup
  • ng-bootstrap button should be focused, but it's not (ex. in Safari/Firefox)
  1. Focus lost after closing on ESC:
  • Focus ng-bootstrap button with keyboard
  • Press ArrowDown to open menu
  • Press Tab to focus first form element (email field)
  • Press Escape to close the menu
  • ng-bootstrap button should be focused, but it's not (all browsers)

Versions of Angular, ng-bootstrap and Bootstrap:

ng-bootstrap: 4.1.1

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

No branches or pull requests

1 participant