
Problem/Motivation
At mobile widths, secondary tabs are re-ordered so the active tab appears first, regardless of its position within the group of tabs. This violates Success Criterion 3.2.3: Consistent Navigation. The tab's position amongst its siblings needs to be the same on every page & viewport width.
This was identified in this Olivero issue: #3129257: Olivero: Mobile tabs can become out of order if browser is resized, which was requesting that Olivero reproduce the Claro behavior reported here.
Steps to reproduce
Go to any page that offers multiple secondary tabs. Visit a tab that isn't the first. On mobile, it is displayed as the first tab despite not actually being the first
Proposed resolution
Find an approach that offers the benefits of showing the active tab without re-ordering it to the first tab on mobile
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#20 | 3210435-20-d94.patch | 2.88 KB | lauriii |
#20 | 3210435-20-d10.patch | 2.9 KB | lauriii |
#18 | 3210435-after_patch.png | 30.9 KB | abhijith s |
#18 | 3210435-before_patch.png | 42.4 KB | abhijith s |
#7 | with patch.png | 87.22 KB | mherchel |
Issue fork drupal-3210435
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
javi-er CreditAttribution: javi-er at Lullabot commentedHi! I made a change to address this, I added a line to `Drupal.behaviors.navTab` to ignore secondary tabs, so these aren't re ordered to show the active element first. Since secondary tabs aren't collapsible, this could probably work regarding a11y issues.
Comment #6
javi-er CreditAttribution: javi-er at Lullabot commentedThis is how it looks after the patch, notice the active secondary tab being second instead of first:
Comment #7
mherchelConfirmed that this looks good and ensures that the secondary navigation items do not reposition themselves. Great fix!
Comment #8
saschaeggiSounds like a solid and obvious change to me. So I'd give that a go from a design point of view. Also I didn't had it present anymore that we did define it to behave this way as discussed with @lauriii in Slack today.
Comment #9
ckrina+1 for me too. I've tested it and works perfect, and the changes make a lot of sense.
Comment #10
lauriiiPosted some feedback on the MR.
Comment #12
sagarchauhan CreditAttribution: sagarchauhan at Material for Drupal India Association commentedComment #14
bnjmnmComment #15
kristen polHmm... MR shows 1000+ changes and
The source branch is 286 commits behind the target branch
... needs to be fixed for 9.4 properly so moving back to needs work.Comment #17
kostyashupenkoRebased & ready for review
Comment #18
abhijith s CreditAttribution: abhijith s as a volunteer and at Zyxware Technologies commentedApplied MR !869 on d9.4.x and its working fine.The reordering of secondary tabs are removed in this patch.
Before patch:

After patch:

RTBC +1
Comment #19
kristen polThanks for the MR update and the testing. Marking RTBC based on:
1. Patch CSS changes is fairly straight forward though I'm not sure it's the approach the Claro team would approve.
2. Patch appears to only address the issue in the issue summary.
3. Issue title and summary are fairly clear.
4. Tests pass.
5. Manual testing passes.
6. Unclear if specific tests can be added for this.
7. Patch applies cleanly to 9.3 and 9.4 and with offsets for 10:
Comment #20
lauriiiComment #23
lauriiiCommitted 36275db and pushed to 10.0.x. Also committed the 9.x patch to 9.4.x. Thanks!