aboutsummaryrefslogtreecommitdiff
path: root/docs/components
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-04-16 14:03:25 -0700
committerMark Otto <[email protected]>2017-04-16 14:03:25 -0700
commit570efe1df6620c9bd6e70cf0bd8d87e42ac6e892 (patch)
treee4a0600341e579a45d4e2fe550362656d503490d /docs/components
parent0cb2576bf25220d35a5f4e1d33c16c2e6f3abaee (diff)
parentea1d69c64be168bb644ae9fc4450a5c85b51609b (diff)
downloadbootstrap-570efe1df6620c9bd6e70cf0bd8d87e42ac6e892.tar.xz
bootstrap-570efe1df6620c9bd6e70cf0bd8d87e42ac6e892.zip
Merge branch 'v4-dev' into form-tweaks
Diffstat (limited to 'docs/components')
-rw-r--r--docs/components/button-group.md4
-rw-r--r--docs/components/carousel.md8
-rw-r--r--docs/components/collapse.md2
-rw-r--r--docs/components/dropdowns.md4
-rw-r--r--docs/components/input-group.md16
-rw-r--r--docs/components/navbar.md18
-rw-r--r--docs/components/navs.md10
7 files changed, 31 insertions, 31 deletions
diff --git a/docs/components/button-group.md b/docs/components/button-group.md
index 59a18e262..5c21e51f7 100644
--- a/docs/components/button-group.md
+++ b/docs/components/button-group.md
@@ -59,7 +59,7 @@ Feel free to mix input groups with button groups in your toolbars. Similar to th
</div>
<div class="input-group">
<span class="input-group-addon" id="btnGroupAddon">@</span>
- <input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon">
+ <input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="btnGroupAddon">
</div>
</div>
@@ -72,7 +72,7 @@ Feel free to mix input groups with button groups in your toolbars. Similar to th
</div>
<div class="input-group">
<span class="input-group-addon" id="btnGroupAddon2">@</span>
- <input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon2">
+ <input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="btnGroupAddon2">
</div>
</div>
{% endexample %}
diff --git a/docs/components/carousel.md b/docs/components/carousel.md
index e75484316..d1606940a 100644
--- a/docs/components/carousel.md
+++ b/docs/components/carousel.md
@@ -28,7 +28,7 @@ Here's a carousel with slides only. Note the presence of the `.d-block` and `.im
{% example html %}
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
- <div class="carousel-inner" role="listbox">
+ <div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
</div>
@@ -48,7 +48,7 @@ Adding in the previous and next controls:
{% example html %}
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
- <div class="carousel-inner" role="listbox">
+ <div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
</div>
@@ -81,7 +81,7 @@ You can also add the indicators to the carousel, alongside the controls, too.
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
- <div class="carousel-inner" role="listbox">
+ <div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
</div>
@@ -120,7 +120,7 @@ Add captions to your slides easily with the `.carousel-caption` element within a
<li data-target="#carouselExampleCaptions" data-slide-to="1"></li>
<li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
</ol>
- <div class="carousel-inner" role="listbox">
+ <div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
<div class="carousel-caption d-none d-md-block">
diff --git a/docs/components/collapse.md b/docs/components/collapse.md
index 0a49db562..a86678ad1 100644
--- a/docs/components/collapse.md
+++ b/docs/components/collapse.md
@@ -119,7 +119,7 @@ You can also create accordions with custom markup. Add the `data-children` attri
## Accessibility
-Be sure to add `aria-expanded` to the control element. This attribute explicitly defines the current state of the collapsible element to screen readers and similar assistive technologies. If the collapsible element is closed by default, it should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute based on whether or not the collapsible element has been opened or closed.
+Be sure to add `aria-expanded` to the control element. This attribute explicitly conveys the current state of the collapsible element tied to the control to screen readers and similar assistive technologies. If the collapsible element is closed by default, the attribute on the control element should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute on the control based on whether or not the collapsible element has been opened or closed (via JavaScript, or because the user triggered another control element also tied to the same collapsbile element).
Additionally, if your control element is targeting a single collapsible element – i.e. the `data-target` attribute is pointing to an `id` selector – you may add an additional `aria-controls` attribute to the control element, containing the `id` of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.
diff --git a/docs/components/dropdowns.md b/docs/components/dropdowns.md
index 3c68f9453..0be8d4d74 100644
--- a/docs/components/dropdowns.md
+++ b/docs/components/dropdowns.md
@@ -480,7 +480,9 @@ Add `.disabled` to items in the dropdown to **style them as disabled**.
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent list item.
-On mobile devices, opening a dropdown adds a `.dropdown-backdrop` as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. **This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile.**
+{% callout info %}
+On touch-enabled devices, opening a dropdown adds empty (`$.noop`) `mouseover` handlers to the immediate children of the `<body>` element. This admittedly ugly hack is necessary to work around a [quirk in iOS' event delegation](https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html), which would otherwise prevent a tap anywhere outside of the dropdown from triggering the code that closes the dropdown. Once the dropdown is closed, these additional empty `mouseover` handlers are removed.
+{% endcallout %}
Note: The `data-toggle="dropdown"` attribute is relied on for closing dropdown menus at an application level, so it's a good idea to always use it.
diff --git a/docs/components/input-group.md b/docs/components/input-group.md
index 0869b70e7..f84cb2453 100644
--- a/docs/components/input-group.md
+++ b/docs/components/input-group.md
@@ -19,11 +19,11 @@ Place one add-on or button on either side of an input. You may also place one on
{% example html %}
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">@</span>
- <input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
+ <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
</div>
<br>
<div class="input-group">
- <input type="text" class="form-control" placeholder="Recipient's username" aria-describedby="basic-addon2">
+ <input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="basic-addon2">
<span class="input-group-addon" id="basic-addon2">@example.com</span>
</div>
<br>
@@ -53,12 +53,12 @@ Add the relative form sizing classes to the `.input-group` itself and contents w
{% example html %}
<div class="input-group input-group-lg">
<span class="input-group-addon" id="sizing-addon1">@</span>
- <input type="text" class="form-control" placeholder="Username" aria-describedby="sizing-addon1">
+ <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="sizing-addon1">
</div>
<br>
<div class="input-group">
<span class="input-group-addon" id="sizing-addon2">@</span>
- <input type="text" class="form-control" placeholder="Username" aria-describedby="sizing-addon2">
+ <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="sizing-addon2">
</div>
{% endexample %}
@@ -124,12 +124,12 @@ Buttons in input groups must wrapped in a `.input-group-btn` for proper alignmen
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
- <input type="text" class="form-control" placeholder="Search for...">
+ <input type="text" class="form-control" placeholder="Search for..." aria-label="Search for...">
</div>
</div>
<div class="col-lg-6">
<div class="input-group">
- <input type="text" class="form-control" placeholder="Search for...">
+ <input type="text" class="form-control" placeholder="Search for..." aria-label="Search for...>
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
@@ -143,7 +143,7 @@ Buttons in input groups must wrapped in a `.input-group-btn` for proper alignmen
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Hate it</button>
</span>
- <input type="text" class="form-control" placeholder="Product name">
+ <input type="text" class="form-control" placeholder="Product name" aria-label="Product name">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Love it</button>
</span>
@@ -240,4 +240,4 @@ Buttons in input groups must wrapped in a `.input-group-btn` for proper alignmen
Screen readers will have trouble with your forms if you don't include a label for every input. For these input groups, ensure that any additional label or functionality is conveyed to assistive technologies.
-The exact technique to be used (`<label>` elements hidden using the `.sr-only` class, or use of the `aria-label`, `aria-labelledby`, `aria-describedby`, `title` or `placeholder` attribute) and what additional information will need to be conveyed will vary depending on the exact type of interface widget you're implementing. The examples in this section provide a few suggested, case-specific approaches.
+The exact technique to be used (`<label>` elements hidden using the `.sr-only` class, or use of the `aria-label` and `aria-labelledby` attributes, possibly in combination with `aria-describedby`) and what additional information will need to be conveyed will vary depending on the exact type of interface widget you're implementing. The examples in this section provide a few suggested, case-specific approaches.
diff --git a/docs/components/navbar.md b/docs/components/navbar.md
index 1aa83ae1c..0891d2327 100644
--- a/docs/components/navbar.md
+++ b/docs/components/navbar.md
@@ -57,7 +57,7 @@ Here's an example of all the sub-components included in a responsive light-theme
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
@@ -192,7 +192,7 @@ Place various form controls and components within a navbar with `.form-inline`.
{% example html %}
<nav class="navbar navbar-light bg-faded">
<form class="form-inline">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
@@ -204,7 +204,7 @@ Align the contents of your inline forms with utilities as needed.
<nav class="navbar navbar-light bg-faded justify-content-between">
<a class="navbar-brand">Navbar</a>
<form class="form-inline">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
@@ -217,7 +217,7 @@ Input groups work, too:
<form class="form-inline">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">@</span>
- <input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
+ <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
</div>
</form>
</nav>
@@ -300,7 +300,7 @@ Theming the navbar has never been easier thanks to the combination of theming cl
</li>
</ul>
<form class="form-inline">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-info my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
@@ -328,7 +328,7 @@ Theming the navbar has never been easier thanks to the combination of theming cl
</li>
</ul>
<form class="form-inline">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-secondary my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
@@ -356,7 +356,7 @@ Theming the navbar has never been easier thanks to the combination of theming cl
</li>
</ul>
<form class="form-inline">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
@@ -458,7 +458,7 @@ With no `.navbar-brand` shown in lowest breakpoint:
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
@@ -516,7 +516,7 @@ With a toggler on the left and brand name on the right:
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
- <input class="form-control mr-sm-2" type="text" placeholder="Search">
+ <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
diff --git a/docs/components/navs.md b/docs/components/navs.md
index fec61ef5d..9ab2535ed 100644
--- a/docs/components/navs.md
+++ b/docs/components/navs.md
@@ -295,7 +295,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin
Use the tab JavaScript plugin—include it individually or through the compiled `bootstrap.js` file—to extend our navigational tabs and pills to create tabbable panes of local content, even via dropdown menus.
-<div class="bd-example bd-example-tabs" role="tabpanel">
+<div class="bd-example bd-example-tabs">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-expanded="true">Home</a>
@@ -357,7 +357,7 @@ Use the tab JavaScript plugin—include it individually or through the compiled
To help fit your needs, this works with `<ul>`-based markup, as shown above, as well as `<nav>`-based markup shown below.
-<div class="bd-example bd-example-tabs" role="tabpanel">
+<div class="bd-example bd-example-tabs">
<nav class="nav nav-tabs" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="home" aria-expanded="true">Home</a>
<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="profile">Profile</a>
@@ -411,7 +411,7 @@ To help fit your needs, this works with `<ul>`-based markup, as shown above, as
The tabs plugin also works with pills.
-<div class="bd-example bd-example-tabs" role="tabpanel">
+<div class="bd-example bd-example-tabs">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-home-tab" data-toggle="pill" href="#pills-home" role="tab" aria-controls="pills-home" aria-expanded="true">Home</a>
@@ -469,7 +469,7 @@ The tabs plugin also works with pills.
And with vertical pills.
-<div class="bd-example bd-example-tabs" role="tabpanel">
+<div class="bd-example bd-example-tabs">
<div class="row">
<div class="col-3">
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist">
@@ -517,7 +517,6 @@ And with vertical pills.
You can activate a tab or pill navigation without writing any JavaScript by simply specifying `data-toggle="tab"` or `data-toggle="pill"` on an element. Use these data attributes on `.nav-tabs` or `.nav-pills`.
-<div role="tabpanel">
{% highlight html %}
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="myTab" role="tablist">
@@ -543,7 +542,6 @@ You can activate a tab or pill navigation without writing any JavaScript by simp
<div class="tab-pane" id="settings" role="tabpanel">...</div>
</div>
{% endhighlight %}
-</div>
### Via JavaScript