This is a followup issue from last night's Drupal Accessibility Office Hours.
The current implementation of the skip link shifts the entire page down when it has focus. This can be disorienting to users when they quickly tab around. It can be seen in the video recording of the focus-style reviews. Demo and discussion of the skip-link starts at around the 4 minute mark.
We can use the method similar to comments #5 and #8 from #3119789: Make skip-link style at consistent at all breakpoints
1. The skip link should be absolutely positioned so it does not affect layout when in focus
2. We need to make sure it respects the administration toolbar placement and is always visible when in focus.


| Comment | File | Size | Author |
|---|---|---|---|
| #35 | Before Patch 3153265.png | 168.43 KB | chetanbharambe |
| #35 | After Patch 3153265.png | 339.72 KB | chetanbharambe |
| #34 | interdiff_29-34.txt | 574 bytes | kiran.kadam911 |
| #34 | 3153265-34.patch | 1023 bytes | kiran.kadam911 |
Comments
Comment #2
kiran.kadam911Comment #3
kiran.kadam911Kindly review the attached patch.
Thanks!
Comment #4
ambuj_gupta commentedComment #5
ambuj_gupta commentedTesting Steps:
1. Apply the patch.
2. Go to site and clear the cache.
3. Visit any page. And press tab and verify the position of Skip to the Main Content link.
3. Verified it for anonymous and authenticated users
Testing Results:
Tested after applying the patch created by @kiran.kadam911. and It's working as expected.
Comment #6
ambuj_gupta commentedComment #7
andrewmacpherson commentedAdding link to video recording of the review in accessibility office hours.
Comment #8
andrewmacpherson commentedIt would be good to get screenshot/gif of the behaviour at narrow viewports (say 360px)
Comment #9
andrewmacpherson commentedComment #10
ambuj_gupta commentedVideo recording of review attached.
Comment #11
ambuj_gupta commentedAre we going to display Skip To Main Link on mobile as well? As per my understanding, we don't need Skip Main Links on Devices because there we don't have keyboard Navigation.
I think we need to hide it for Devices.
Comment #12
andrewmacpherson commentedThanks for the video demos @ambuj_gupta. Both of the videos in #10 and #11 are good.
In #11, showing a narrow (mobile) viewport, the skip link obscures the site name while the skip link is focused. This is acceptable per WCAG success criterion 1.4.13 Content on Hover or Focus.
YES - we need to make this skip link available on all devices.
It's incorrect to say that phones, tablets, etc. don't have keyboard navigation:
Comment #13
kiran.kadam911Comment #14
mherchelComment #15
komalk commentedComment #16
komalk commentedComment #17
mherchelThe skip link isn't visible when the admin toolbar is present. We need to account for that (in all of its permutations).
Comment #18
kostyashupenkoBlocker https://www.drupal.org/project/drupal/issues/2958478 to resolve issue pointed in previous comment
Comment #19
hinal05 commentedComment #20
hinal05 commentedPlease review the attached patch.
Comment #21
hinal05 commentedPlease refer updated patch.
Comment #22
abhijith s commentedApplied patch #21 and it works fine.Adding screenshots below.
Before patch:

After patch:

Mobile

Comment #23
gauravvvv commentedPatch #21, Working fine and fixed the layout shift issue.
Adding after patch screenshot for reference.
Moving to RTBC.
Comment #24
gauravvvv commentedComment #25
mherchelThis looks good except for the empty line that's removed.
No need to remove this empty line.
Comment #26
kishor_kolekar commentedHey, I have tried to cover the points mentioned in #25
Please review
Comment #27
kishor_kolekar commentedComment #28
mherchelComment #29
mherchelRe-uploading the exact same patch from #26, so we can test this against 9.2.x (Drupal CI wouldn't let me add a test through the 'add test' link)
Comment #30
sakthivel m commentedThanks patch @mherchel, @kishor_kolekar

#26 patch applied. The patch is working fine
Comment #31
bhumikavarshney commentedHI @mherchel,
Patch #29, Working fine.
Fixed the layout shift issue.
Adding after patch screenshot for reference.
Moving to RTBC.
Comment #33
lauriiiposition: absolutemakes the focus ring visible. The while focus ring doesn't work well in this use case. Since the focus ring is not visible before, we should probably make it invisible here.Comment #34
kiran.kadam911Providing updated & re-rolled 9.3.x patch as per #33 removing outline on focus.
Kindly review.
Thanks!
Comment #35
chetanbharambe commentedVerified and tested patch #34.
Patch applied successfully and looks good to me.
Testing Steps:
# Press tab button
# User is able to see "Skip to main content"
Expected Results:
# User should not see white focus ring under skip to main content
Actual Results:
# Currently user is able to see the white focus line under skip to main content.
Can be a move to RTBC.
Comment #38
lauriiiCommitted 8f711d9 and pushed to 9.3.x and 9.2.x. Thanks!
Comment #39
gauravvvv commented