1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 17:14:04 +02:00

Add tabindex="0" whenever .overflow-*-{auto|scroll} are used for a11y

This commit is contained in:
Julien Déramond
2023-07-25 14:54:53 +02:00
parent 8e5dada5b1
commit c9f655f005
4 changed files with 15 additions and 15 deletions

View File

@@ -1454,7 +1454,7 @@ direction: rtl
</li>
</ul>
</nav>
<div data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="0" class="scrollspy-example position-relative mt-2 overflow-auto">
<div data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="0" class="scrollspy-example position-relative mt-2 overflow-auto" tabindex="0">
<h4 id="fat"><bdi lang="en" dir="ltr">@fat</bdi></h4>
<p>محتوى لتوضيح كيف تعمل المخطوطة. ببساطة، المخطوطة عبارة عن منشور طويل يحتوي على عدة أقسام، ولديه شريط تنقل يسهل الوصول إلى هذه الأقسام الفرعية.</p>
<h4 id="mdo"><bdi lang="en" dir="ltr">@mdo</bdi></h4>

View File

@@ -90,7 +90,7 @@ extra_js:
<h5 class="offcanvas-title" id="sidebarMenuLabel">Company name</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#sidebarMenu" aria-label="يغلق"></button>
</div>
<div class="offcanvas-body d-md-flex flex-column p-0 pt-lg-3 overflow-y-auto">
<div class="offcanvas-body d-md-flex flex-column p-0 pt-lg-3 overflow-y-auto" tabindex="0">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link d-flex align-items-center gap-2 active" aria-current="page" href="#">

View File

@@ -89,7 +89,7 @@ extra_js:
<h5 class="offcanvas-title" id="sidebarMenuLabel">Company name</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#sidebarMenu" aria-label="Close"></button>
</div>
<div class="offcanvas-body d-md-flex flex-column p-0 pt-lg-3 overflow-y-auto">
<div class="offcanvas-body d-md-flex flex-column p-0 pt-lg-3 overflow-y-auto" tabindex="0">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link d-flex align-items-center gap-2 active" aria-current="page" href="#">

View File

@@ -11,7 +11,7 @@ toc: true
Adjust the `overflow` property on the fly with four default values and classes. These classes are not responsive by default.
<div class="bd-example d-md-flex">
<div class="overflow-auto p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary" style="max-width: 260px; max-height: 100px;">
<div class="overflow-auto p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary" style="max-width: 260px; max-height: 100px;" tabindex="0">
This is an example of using <code>.overflow-auto</code> on an element with set width and height dimensions. By design, this content will vertically scroll.
</div>
<div class="overflow-hidden p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary" style="max-width: 260px; max-height: 100px;">
@@ -20,16 +20,16 @@ Adjust the `overflow` property on the fly with four default values and classes.
<div class="overflow-visible p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary" style="max-width: 260px; max-height: 100px;">
This is an example of using <code>.overflow-visible</code> on an element with set width and height dimensions.
</div>
<div class="overflow-scroll p-3 bg-body-tertiary" style="max-width: 260px; max-height: 100px;">
<div class="overflow-scroll p-3 bg-body-tertiary" style="max-width: 260px; max-height: 100px;" tabindex="0">
This is an example of using <code>.overflow-scroll</code> on an element with set width and height dimensions.
</div>
</div>
```html
<div class="overflow-auto">...</div>
<div class="overflow-auto" tabindex="0">...</div>
<div class="overflow-hidden">...</div>
<div class="overflow-visible">...</div>
<div class="overflow-scroll">...</div>
<div class="overflow-scroll" tabindex="0">...</div>
```
### `overflow-x`
@@ -37,7 +37,7 @@ Adjust the `overflow` property on the fly with four default values and classes.
Adjust the `overflow-x` property to affect the overflow of content horizontally.
<div class="bd-example d-md-flex">
<div class="overflow-x-auto p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px; white-space: nowrap;">
<div class="overflow-x-auto p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px; white-space: nowrap;" tabindex="0">
<div><code>.overflow-x-auto</code> example on an element</div>
<div> with set width and height dimensions.</div>
</div>
@@ -49,17 +49,17 @@ Adjust the `overflow-x` property to affect the overflow of content horizontally.
<div><code>.overflow-x-visible</code> example </div>
<div>on an element with set width and height dimensions.</div>
</div>
<div class="overflow-x-scroll p-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;white-space: nowrap;">
<div class="overflow-x-scroll p-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;white-space: nowrap;" tabindex="0">
<div><code>.overflow-x-scroll</code> example on an element</div>
<div> with set width and height dimensions.</div>
</div>
</div>
```html
<div class="overflow-x-auto">...</div>
<div class="overflow-x-auto" tabindex="0">...</div>
<div class="overflow-x-hidden">...</div>
<div class="overflow-x-visible">...</div>
<div class="overflow-x-scroll">...</div>
<div class="overflow-x-scroll" tabindex="0">...</div>
```
### `overflow-y`
@@ -67,7 +67,7 @@ Adjust the `overflow-x` property to affect the overflow of content horizontally.
Adjust the `overflow-y` property to affect the overflow of content vertically.
<div class="bd-example d-md-flex">
<div class="overflow-y-auto p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;">
<div class="overflow-y-auto p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;" tabindex="0">
<code>.overflow-y-auto</code> example on an element with set width and height dimensions.
</div>
<div class="overflow-y-hidden p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;">
@@ -76,16 +76,16 @@ Adjust the `overflow-y` property to affect the overflow of content vertically.
<div class="overflow-y-visible p-3 mb-3 mb-md-0 me-md-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;">
<code>.overflow-y-visible</code> example on an element with set width and height dimensions.
</div>
<div class="overflow-y-scroll p-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;">
<div class="overflow-y-scroll p-3 bg-body-tertiary w-100" style="max-width: 200px; max-height: 100px;" tabindex="0">
<code>.overflow-y-scroll</code> example on an element with set width and height dimensions.
</div>
</div>
```html
<div class="overflow-y-auto">...</div>
<div class="overflow-y-auto" tabindex="0">...</div>
<div class="overflow-y-hidden">...</div>
<div class="overflow-y-visible">...</div>
<div class="overflow-y-scroll">...</div>
<div class="overflow-y-scroll" tabindex="0">...</div>
```
Using Sass variables, you may customize the overflow utilities by changing the `$overflows` variable in `_variables.scss`.