Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Fix issue where focus is stolen from form elements after dropdown shown #6369

Closed
wants to merge 4 commits into from

Conversation

mondayuk
Copy link

Discovered an issue where form elements were losing their focus. Discovered this was related to #5934 having added a feature to apply the focus to the toggle element, but as this event fires on all mouse clicks the focus was being set regardless of whether the dropdown was actually open at the time.

@mondayuk mondayuk closed this Dec 14, 2016
@mondayuk mondayuk reopened this Dec 14, 2016
@wesleycho
Copy link
Contributor

I believe this was originally added for accessibility reasons - does this preserve the accessibility situation denoted in #5782?

@mondayuk
Copy link
Author

Yes, the functionality is preserved when the popup closes (which is the intention of the fix) but it resolves the issue that the focus continues to be reverted back to the toggle control even after the popup has been closed.

This issue can be seen on https://angular-ui.github.io/bootstrap/. Click to open the dropdown then close, then try and focus on something else on the page (for example, one of the text boxes next to the date pickers) focus is pulled back to the dropdown.

@dougludlow
Copy link
Contributor

FYI, @lukehutton added e07f9fd to #6353 to fix the same issue.

@mondayuk
Copy link
Author

Looks like that was done after mine and (unless i'm mistaken) has no pull request yet. Functionally identical though.

@mondayuk
Copy link
Author

Oh actually, I see it is associated with a pull request. No preference on which makes it in.

@wesleycho
Copy link
Contributor

Going to close this as I merged #6382 instead as the proper fix - thanks for the attempt, the fix should be in the latest release.

@wesleycho wesleycho closed this Jan 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants