Skip to content

Toolbar toggler accessibility #37889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,11 @@
}
};
}
addEventListener(document.getElementById('sfToolbarHideButton-' + newToken), 'click', function (event) {
var hideButton = document.getElementById('sfToolbarHideButton-' + newToken);
var hideButtonSvg = hideButton.querySelector('svg');
hideButtonSvg.setAttribute('aria-hidden', 'true');
hideButtonSvg.setAttribute('focusable', 'false');
addEventListener(hideButton, 'click', function (event) {
event.preventDefault();

var p = this.parentNode;
Expand All @@ -482,7 +486,11 @@
document.getElementById('sfMiniToolbar-' + newToken).style.display = 'block';
setPreference('toolbar/displayState', 'none');
});
addEventListener(document.getElementById('sfToolbarMiniToggler-' + newToken), 'click', function (event) {
var showButton = document.getElementById('sfToolbarMiniToggler-' + newToken);
var showButtonSvg = showButton.querySelector('svg');
showButtonSvg.setAttribute('aria-hidden', 'true');
showButtonSvg.setAttribute('focusable', 'false');
addEventListener(showButton, 'click', function (event) {
event.preventDefault();

var elem = this.parentNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
z-index: 99999;
}

.sf-minitoolbar a {
display: block;
.sf-minitoolbar button {
background-color: transparent;
padding: 0;
border: none;
}
.sf-minitoolbar svg,
.sf-minitoolbar img {
Expand Down Expand Up @@ -81,10 +83,13 @@
height: 36px;
cursor: pointer;
text-align: center;
border: none;
margin: 0;
padding: 0;
}
.sf-toolbarreset .hide-button svg {
max-height: 18px;
margin-top: 10px;
margin-top: 1px;
}

.sf-toolbar-block {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- START of Symfony Web Debug Toolbar -->
<div id="sfMiniToolbar-{{ token }}" class="sf-minitoolbar" data-no-turbolink>
<a href="#" title="Show Symfony toolbar" tabindex="-1" id="sfToolbarMiniToggler-{{ token }}" accesskey="D">
<button type="button" title="Show Symfony toolbar" id="sfToolbarMiniToggler-{{ token }}" accesskey="D" aria-expanded="false" aria-controls="sfToolbarMainContent-{{ token }}">
{{ include('@WebProfiler/Icon/symfony.svg') }}
</a>
</button>
</div>
<div id="sfToolbarClearer-{{ token }}" class="sf-toolbar-clearer"></div>

Expand All @@ -23,8 +23,8 @@
{% endif %}
{% endfor %}

<a class="hide-button" id="sfToolbarHideButton-{{ token }}" title="Close Toolbar" tabindex="-1" accesskey="D">
<button class="hide-button" type="button" id="sfToolbarHideButton-{{ token }}" title="Close Toolbar" accesskey="D" aria-expanded="true" aria-controls="sfToolbarMainContent-{{ token }}">
{{ include('@WebProfiler/Icon/close.svg') }}
</a>
</button>
</div>
<!-- END of Symfony Web Debug Toolbar -->