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

Dropdown Key Navigation doesn't work when "dropdownAppendToBody" is enabled #4091

Closed
robertaistleitner opened this issue Aug 3, 2015 · 7 comments

Comments

@robertaistleitner
Copy link

When pressing up/down arrow buttons it causes an exception in the "keyboardNav" directive in this line:

var elems = angular.element(element).find('a');

I think this line fixes this issue (accessing the dropdownMenu jQuery element from a reference):

var elems = dropdownCtrl.dropdownMenu.find('a');
@icfantv
Copy link
Contributor

icfantv commented Aug 3, 2015

@robertaistleitner, please create a working plunker that demonstrates this issue and link it here. Thanks.

@wesleycho
Copy link
Contributor

Definitely a bug.

@wesleycho
Copy link
Contributor

Want to tackle it @icfantv? Should be an easy fix - otherwise I can tackle it.

@icfantv
Copy link
Contributor

icfantv commented Aug 4, 2015

Yea, I can take a look.

@robertaistleitner
Copy link
Author

Thanks guys, I was in a hurry yesterday.. ;)

@icfantv
Copy link
Contributor

icfantv commented Aug 4, 2015

Looks like that plunker is horked. With the fix in place, you can't navigate past the first list item and the keyboard navigation no longer responds. Here's an updated one with the proposed fix in place.

icfantv added a commit to icfantv/bootstrap that referenced this issue Aug 4, 2015
- properly handle arrow key navigation in dropdown button menus

fixes angular-ui#4091
icfantv added a commit to icfantv/bootstrap that referenced this issue Aug 4, 2015
- fix bug in directive whereby list item selector is not being initiated on
  correct DOM element.
- fix bug in directive whereby invalid `keyCode` property of jQuery Event
  object is being referenced instead of `which`.
- update functional test to trigger keydown event on correct DOM element
  because otherwise the keydown handler in the directive is not getting
  executed.
- remove invalid functional test because it is not possible to trigger a
  keydown event on a hidden DOM element through normal UI interaction.

fixes angular-ui#4091
@icfantv icfantv closed this as completed in 0b37f08 Aug 5, 2015
@GregePorter
Copy link

I am seeing the commit, 0b37f08, and I am running the most current build and I'm still seeing this error.
@robertaistleitner, plunkr is still working and it demonstrates the error. His solution works too (I tried it locally)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants