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 perf - on keyboard nav, search for active item in the current dropdown rather than the whole document #19953

Merged
merged 1 commit into from
Nov 26, 2016

Conversation

pvdlg
Copy link
Contributor

@pvdlg pvdlg commented May 22, 2016

Currently when navigating a dropdown with the keyboard, in order to determine the current index, this selector is used to find the active elements on the whole document.
All the dropdown-items on the page are retrieved and looped on with a call to item.offsetWidth and item.offsetHeight to determine if they are currently visible.

With this PR the active items are searched only under the parent dropdown.
In addition it avoid the necessity to call item.offsetWidth and item.offsetHeight.

On a side note, the keyboard navigation currently doesn't work in v4 as there is a discrepancy between the html markup (from the documentation) and the javascript. See #19864 for the fix.

@cvrebert
Copy link
Collaborator

Refs #18454

@XhmikosR
Copy link
Member

LGTM

@mdo mdo added this to the v4.0.0-alpha.6 milestone Nov 26, 2016
@mdo mdo merged commit 3606c5b into twbs:v4-dev Nov 26, 2016
@pvdlg pvdlg deleted the dropdown-perf branch December 29, 2016 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants