Speech: I say "Go to next tab" ...Mick wrote: Thu Oct 13, 2022 10:13 am Hmm, I see what you mean, but I suspect they may be accessible via [tab] or [ctrl+chr] (not tested) although not ideal. Does anyone navigate anything these days without a mouse or touch screen?
YesMick wrote: Thu Oct 13, 2022 10:13 am Does anyone navigate anything these days without a mouse or touch screen?
Code: Select all
// Update the dropdown trigger to show the new value
parent.querySelector('span.dropdown-trigger').innerText = text;
parent.querySelector('input[data-name^=role]').value = roleId;
It was. I've checked. There are 12 instances of it in the 3.3.12 templates.Aidy wrote: Sun Jul 21, 2024 10:45 am Using span for dropdown triggers isn’t ideal for accessibility since span elements aren’t focusable by default. It’s possible that the dropdown-trigger class was used inconsistently.
Code: Select all
prosilver\template\display_options.html (2 hits)
Line 1: <div class="dropdown-container dropdown-container-left dropdown-button-control sort-tools">
prosilver\template\jumpbox.html (2 hits)
Line 30: <div class="jumpbox dropdown-container dropdown-container-right<!-- IF not S_IN_MCP --> dropdown-up<!-- ENDIF --> dropdown-{S_CONTENT_FLOW_BEGIN} dropdown-button-control" id="jumpbox">
prosilver\template\memberlist_search.html (1 hit)
Line 14: <!-- IF U_LIVE_SEARCH --><div class="dropdown-container dropdown-{S_CONTENT_FLOW_END}"><!-- ENDIF -->
prosilver\template\navbar_header.html (3 hits)
Line 6: <li id="quick-links" class="quick-links dropdown-container responsive-menu<!-- IF not S_DISPLAY_QUICK_LINKS and not S_DISPLAY_SEARCH --> hidden<!-- ENDIF -->" data-skip-responsive="true">
Line 106: <div class="header-profile dropdown-container">
Line 155: <li class="dropdown-container dropdown-{S_CONTENT_FLOW_END} rightside" data-skip-responsive="true">
prosilver\template\pagination.html (1 hit)
Line 3: <li class="dropdown-container dropdown-button-control dropdown-page-jump page-jump">
prosilver\template\ucp_pm_message_header.html (1 hit)
Line 33: <div class="dropdown-container dropdown-button-control topic-tools">
prosilver\template\ucp_pm_viewmessage.html (1 hit)
Line 59: <div class="dropdown-container dropdown-left">
prosilver\template\viewtopic_body.html (3 hits)
Line 181: <div class="dropdown-container dropdown-left">
Line 427: <div class="quickmod dropdown-container dropdown-container-left dropdown-up dropdown-{S_CONTENT_FLOW_END} dropdown-button-control" id="quickmod">
prosilver\template\viewtopic_topic_tools.html (1 hit)
Line 2: <div class="dropdown-container dropdown-button-control topic-tools">
Buttons are better. Really. Anchors are for taking you somewhere else. Buttons do stuff on the same page. They are made for it.It might be worth suggesting a change to ensure all dropdowns use anchors (<a>) or are made keyboard-accessible.
No, its not that bad. It does have navigable anchors in lots of place (ie: pagination) and sensible things like h2's and h3's (which are not inherently focusable but are handy for screen readers). Most of the page is quite usable. It's just that a few aspects could be improved, and it wouldn't be that big a job.danieltj wrote: Sun Jul 21, 2024 12:46 pm I tried to use keyboard based navigation around this topic to do some quick testing and the two search boxes are the only things that are navigable. Everything else isn't intractable which is quite surprising.
Code: Select all
<script>
const triggers = document.querySelectorAll('li.dropdown-container');
for (const trigger of triggers) {
// Add .dropstop to class list.
trigger.classList.add('dropstop');
const button = trigger.firstElementChild
document.addEventListener('click', (event) => {
// Toggle menu open/closed via click/Enter/tap.
if (button.contains(event.target)) {trigger.classList.toggle('dropstop')}
// Menu stays open if target is child element.
else if (trigger.contains(event.target)) {return}
// Click/tap anywhere outside to close.
else {trigger.classList.add('dropstop')}
});
// Reset to closed on tabbing out, or via Esc.
document.addEventListener('keyup', (event) => {
if (!trigger.contains(event.target) || (event.code == 'Escape')) {trigger.classList.add('dropstop')}
});
}
</script>
Code: Select all
const triggers=document.querySelectorAll("li.dropdown-container");for(const t of triggers){t.classList.add("dropstop");const s=t.firstElementChild;document.addEventListener("click",e=>{if(s.contains(e.target))t.classList.toggle("dropstop");else{if(t.contains(e.target))return;t.classList.add("dropstop")}}),document.addEventListener("keyup",s=>{t.contains(s.target)&&"Escape"!=s.code||t.classList.add("dropstop")})}
Code: Select all
.dropdown, .dropdown-container.dropstop:focus-within .dropdown {
display: none;
}
.dropdown-container:focus-within .dropdown {
display: block;
}
I'm just finishing up implementing my menu idea* for my own use, and noticed something else. The default quickreply_editor.html is a disaster for keyboard nav. It has tabindex="2" on the subject input, tabindex="3" on the textarea, then tabindex="6" and tabindex="7" on the preview and submit buttons. It makes no logical sense in terms of numbering, because 1, 4 and 5 are missing, but that's not the real issue.danieltj wrote: Sun Jul 21, 2024 12:46 pm I tried to use keyboard based navigation around this topic to do some quick testing and the two search boxes are the only things that are navigable. Everything else isn't intractable which is quite surprising.