aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit
diff options
context:
space:
mode:
authorPatrick H. Lauke <[email protected]>2015-06-02 09:41:40 +0100
committerPatrick H. Lauke <[email protected]>2015-06-02 11:03:21 +0100
commit5fd7bc1554d492bdd5794d35fce515fe951439a6 (patch)
tree61ac7cd8243c6d6c4c6e8de4b373132b01419df7 /js/tests/unit
parent3b59b97c626bf2accef8217339b04712666c36d9 (diff)
downloadbootstrap-5fd7bc1554d492bdd5794d35fce515fe951439a6.tar.xz
bootstrap-5fd7bc1554d492bdd5794d35fce515fe951439a6.zip
generalize dropdowns / drop role="menu"
as role="menu" is a very specific (and strict) ARIA pattern for desktop-like application menus, and our dropdowns are often used as pure navigation dropdowns, this change abandons ARIA menus for a more open-ended and light-weight approach (see http://heydonworks.com/practical_aria_examples/#submenus and http://www.w3.org/WAI/tutorials/menus/flyout/#improve-screen-reader-support-using-wai-aria) note that in dropdown.js, switched to now target ``.dropdown-menu`` instead of ``role["menu"]`` - this also prevents bootstrap scripts from "bleeding" into non-bootstrap components on the same page. also removed the ``role=["listbox"]`` part, which appears to be vestigial/unused (only place in bootstrap that uses that role are carousels, and their key handling is done separately)
Diffstat (limited to 'js/tests/unit')
-rw-r--r--js/tests/unit/dropdown.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/tests/unit/dropdown.js b/js/tests/unit/dropdown.js
index e0d1df970..a55684d52 100644
--- a/js/tests/unit/dropdown.js
+++ b/js/tests/unit/dropdown.js
@@ -186,7 +186,7 @@ $(function () {
+ '<li><a href="#menu1">Menu 1</a></li>'
+ '<li class="dropdown" id="testmenu">'
+ '<a class="dropdown-toggle" data-toggle="dropdown" href="#testmenu">Test menu <span class="caret"/></a>'
- + '<ul class="dropdown-menu" role="menu">'
+ + '<ul class="dropdown-menu">'
+ '<li><a href="#sub1">Submenu 1</a></li>'
+ '</ul>'
+ '</li>'
@@ -293,7 +293,7 @@ $(function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
- + '<ul class="dropdown-menu" role="menu">'
+ + '<ul class="dropdown-menu">'
+ '<li><a href="#">Secondary link</a></li>'
+ '<li><a href="#">Something else here</a></li>'
+ '<li class="divider"/>'
@@ -333,7 +333,7 @@ $(function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
- + '<ul class="dropdown-menu" role="menu">'
+ + '<ul class="dropdown-menu">'
+ '<li class="disabled"><a href="#">Disabled link</a></li>'
+ '<li><a href="#">Another link</a></li>'
+ '</ul>'
@@ -355,7 +355,7 @@ $(function () {
assert.expect(1)
var dropdownHTML = '<div class="btn-group">'
+ '<button type="button" data-toggle="dropdown">Dropdown</button>'
- + '<ul class="dropdown-menu" role="menu">'
+ + '<ul class="dropdown-menu">'
+ '<li><input id="textField" type="text" /></li>'
+ '</ul>'
+ '</div>'
@@ -374,7 +374,7 @@ $(function () {
assert.expect(1)
var dropdownHTML = '<div class="btn-group">'
+ '<button type="button" data-toggle="dropdown">Dropdown</button>'
- + '<ul class="dropdown-menu" role="menu">'
+ + '<ul class="dropdown-menu">'
+ '<li><textarea id="textArea"></textarea></li>'
+ '</ul>'
+ '</div>'