- Issue created by @bwaindwain
- Merge request !77Remove JS that inteferes with Drupal's toolbar mobile behaviour → (Merged) created by bwaindwain
- Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
11 months ago Waiting for branch to pass - Status changed to Needs review
11 months ago 10:00pm 4 June 2024 - 🇮🇳India pray_12
The above MR solves the issue of a second click being required for certain screen widths.
- 🇮🇳India riddhi.addweb
I have applied the patch, it resolves the issue.
Please check the attachment for the reference.
Attachment : https://imgur.com/a/6u8N3sj - Status changed to RTBC
10 months ago 7:16am 18 June 2024 - First commit to issue fork.
- 🇫🇷France dydave
Thanks for finding this!
I've done a bit of testing and I "think" I was able to reproduce with the steps clearly detailed in the IS.
I need to do a bit of digging though to see where and why this code was initially added.
Needs a bit more time testing, but bringing this back to the top of the stack.
Thanks! -
dydave →
committed da09a6a7 on 3.x authored by
bwaindwain →
Issue #3452561 by bwaindwain, dydave: Reverted changes from 'Hide the...
-
dydave →
committed da09a6a7 on 3.x authored by
bwaindwain →
- 🇫🇷France dydave
Thanks a lot everyone for your great help on this issue! 🥳
Thank you very much for making the steps very clear in the IS:
Indeed, I was able to reproduce the issue and make a bit of digging around the impacted piece of code:It seems the piece of code removed in MR!77 stems from an initial request in:
Issue #2991056: Always hide active menu item's navigation on mobile → ,
with commit:
https://git.drupalcode.org/project/admin_toolbar/-/commit/c1e705ff67b6d5...which would seem to have "broken" module's previous JS behavior and led to:
Issue #3172430: Hide the navigation menu on mobile properly →
with commit:
https://git.drupalcode.org/project/admin_toolbar/-/commit/6dd6516
We can't be sure whether this change is going to break the expected behavior on some sites, but since this piece of code is currently causing an issue it is probably safe to assume, these changes should be reverted for now.
Perhaps the way this feature was initially introduced in the module should have taken a different approach?!
Maybe it could have been added as a form setting or in a sub-module, for example.Personally, I don't think it would be a good idea anyway to have a different behavior between larger and smaller devices.
Additionally, if this was the case, we would probably want to alter JS variables set in the Local Storage by the Core Toolbar module, instead of changing the DOM elements of the page.Again, we wouldn't be closed or opposed to discussing the reverted feature again, if anybody would still be interested in working on this feature.
Since the jobs and tests were passing 🟢, I went ahead and merged the changes above at #10.
Marking issue as Fixed, for now.
Thanks again everyone for the great work and contributions! 🙏