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

fix(dropdown): keyboard navigation #3212

Closed
wants to merge 1 commit into from
Closed

Conversation

yarl
Copy link

@yarl yarl commented Jan 21, 2015

Add option to use up and down arrows to navigate through list.
Fixes #1228

@karianna
Copy link
Contributor

Hi @yarl - Thanks for the PR - are you also able to add some test(s) around it?

@porjo
Copy link

porjo commented Mar 2, 2015

+1

@@ -90,6 +91,27 @@ angular.module('ui.bootstrap.dropdown', [])
self.toggleElement[0].focus();
}
};

scope.selectOption = function( evt ) {
var elems = angular.element(self.$element).find('.dropdown-menu a');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to create a directive where when a value is true, then it focuses on the element.

@wesleycho
Copy link
Contributor

As mentioned, this is in need of tests currently.

@bleggett
Copy link
Contributor

Have a PR that adds this functionality. Started with yarl's fix but made it an optional flag, added some tests, and removed the apparent dependency on jQuery.

angular.element(self.$element).find('.dropdown-menu a'); was not working for me, and unless I'm wrong should not work with vanilla jQLite.

bleggett added a commit to bleggett/bootstrap that referenced this pull request Jun 3, 2015
fix(dropdown): Fixed indexing corner cases and filter key events.

fix(dropdown): Try using document.bind instead

fix(dropdown): Add optional attrib for keyboard-nav.

fix(dropdown): Dedup code and handle differences if dropdown-menu used

fix(dropdown): Fix focus issue and add more tests

fix(dropdown): Update docs with example

fix(dropdown): Revert accidental change to misc/demo/index.html

fix(dropdown): Revert accidental indent changes to dropdown demo.html

feat(dropdown): Add keynav support for dropdown menus (angular-ui#1228 and angular-ui#3212)
@wesleycho wesleycho closed this in 6235937 Jun 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arrow keys don't work in DropdownToggle
5 participants