Problem/Motivation
While working on tests in #3393400: Implement Nightwatch tests for Navigation module. I could not click any links inside of the admin toolbar. It turns out it is due to .admin-toolbar__scroll-wrapper having display: contents;
I went to Can I Use and found there are problems with display: contents; in all major browsers: https://caniuse.com/?search=display%3A%20contents
Buttons are not accessible with display: contents applied. See issues for Chromium, Firefox, and WebKit
Steps to reproduce
I haven't manually reproduced by trying to tab and focus on buttons.
See https://issues.chromium.org/issues/40866683 with a non-Drupal example.
Proposed resolution
Remove display: contents;
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | Screenshot 2024-05-10 at 8.31.25 AM.png | 110.84 KB | gauravvvv |
Issue fork drupal-3446357
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:
- 3446357-buttons-are-not
changes, plain diff MR !8008
Comments
Comment #2
mherchelThe Chromium issue above is slightly different. It deals with setting
display: contentsdirectly on the<button>, which is not what we're doing.From what I see, we're only applying it in one place on
.admin-toolbar__scroll-wrapperI'll investigate a bit more.
Comment #4
mglamanOpened an MR that wholesale removes it, not sure the consequences
Comment #5
mglaman@mherchel, you're right. I took https://cdpn.io/aardrian/debug/NWqbggX and but the button inside of a div with
display: contents. Maybe it's a bug in Chromedriver itself?Comment #6
mglamanI found https://github.com/SeleniumHQ/selenium/issues/6977 and their fix https://github.com/SeleniumHQ/selenium/commit/bbdf7c28a14645c3f5c53f2492...
I don't exactly know the way forward, but it shows the fix is not removing
display: contentsbut investigating the test issueComment #7
mglamanI've also found https://github.com/angular/protractor/issues/4951. There is no solution but some details to the problem.
We're in that situation with
Comment #8
mglamanThis failed
This also failed
This passed.
So it is not
display: contents;. Only in combination with overflowComment #9
mglamanMarking for review, I have no idea the impact of the overflow. But from I've read, it isn't needed.
Comment #10
mglamanComment #11
gauravvvv commentedRemoving
overflow-y: auto;is having impact on design in mobile devices. See screenshot for reference.Comment #12
gauravvvv commentedComment #13
mglamanFound another report of this combo failing tests with Cypress: https://github.com/cypress-io/cypress/issues/25199
Comment #14
mglaman@Gauravvvv thanks for adding a fix! I'll copy it to a test I have to verify it makes WebDriver happy
Comment #16
finnsky commentedI've tested. seems all fine.
Comment #17
mglaman@finnsky did you re-run the linked Nightwatch test? Or manually test.
Comment #18
finnsky commentedNope. I just checked for regressions in tugboat instance
Comment #19
mglamanOkay, going to move to NW because this all kicked off since it's not accessible when testing with WebDriver and that needs to be verified. I'll be at a computer soon
Comment #20
mglaman🙌 the Nightwatch test passed locally for me with these changes. I copied them over to #3393400: Implement Nightwatch tests for Navigation module, waiting to double verify with pipeline https://git.drupalcode.org/issue/drupal-3393400/-/pipelines/169765
Comment #21
smustgrave commented@mglaman should this be Needs work per #19?
Comment #22
mglamanThe test passed with this added before the a11y test was added there. It's a horrible chicken and egg problem of "What do we fix where?" We could fix this with the tests, but it seems like it should be its own fix. As far as I can tell, this issue fixes the visibility bug and can be RTBC'd and unblock testing the new Navigation module.
Comment #23
smustgrave commentedSounds good.
Comment #24
nod_updating title
Comment #30
nod_Committed and pushed cdc8135c56 to 11.x and 87ae449bf4 to 11.0.x and 8ac8832201 to 10.4.x and 2fffa8f31d to 10.3.x. Thanks!