When in mobile mode, when the side navigation closes, it does not properly reset Drupal.displace() (which is an API that informs if a component is fixed to a side of the window).
You can see this by watching the dynamically generated CSS variables on the HTML tag.

Proposed resolution
Set width of `admin-toolbar__displace-placeholder` only for desktop. On mobile we don't need that displace.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | Zrzut ekranu 2025-05-5 o 08.30.04.png | 487.67 KB | bronismateusz |
| #18 | ca5603b5bdc8eb4b88575a03856f830f.gif | 627.21 KB | finnsky |
| #18 | 5e939d0ee4be9996c7ce46aff4dfc98f.gif | 865.53 KB | finnsky |
| #9 | before-patch.gif | 628.05 KB | arunkumark |
| #9 | After-patch.gif | 440.25 KB | arunkumark |
Issue fork drupal-3443576
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:
- 3443576-css-only
changes, plain diff MR !7958
- 3443576-mobile-version-of
changes, plain diff MR !7951
Comments
Comment #2
ckrinaComment #3
ckrinaComment #5
mherchelComment #6
finnsky commentedI think we can do it simpler here.
`admin-toolbar__displace-placeholder` should be responsive probably.
Comment #8
finnsky commentedYes.
Seems it was not about transitions but about default value of `admin-toolbar__displace-placeholder` which was 72px as for collapsed desktop sidebar.
CSS works here. Please review.
Comment #9
arunkumarkTested the MR, Working fine. Please find the attached screenshot for reference.
Before patch apply

After patch apply

Comment #11
mherchel+1 RTBC. Not setting the width of the element that displace monitors until it's at the appropriate width makes sense. Good solution!
Comment #12
nod_I'm not sure this is the right fix. I can still get the menu icon offset with the patch on the desktop resolution with the menu collapsed. it does fix the mobile use case but I think we need to fix it once for all the use cases.
I think the root of the issue is this rule:
This doesn't seem to work like expected. this would make sense for absolute/fixed positioned elements, but .containers are not, from what I can see they're managed with flexbox, so we don't need to account for anything special.
There is another issue with displace, there is a 9px offset on top, when there should be none.
Comment #13
nod_umm maybe that needs to be a follow-up issue
Comment #18
finnsky commentedI got what you mean, but it is out of scope of navigation module. even more. this is not new problem
problem now:
problem before:
So i suggest to open Olivero ticket for this.
Comment #19
finnsky commentedComment #20
smustgrave commentedTagging for follow up in #18
Comment #21
smustgrave commentedCan issue summary be updated to include proposed solution
Comment #22
gauravvvv commentedFollow up issue created.
Comment #23
finnsky commentedComment #24
smustgrave commentedThanks all feedback appears to be addressed.
Comment #30
nod_Committed and pushed 9a6641dea3 to 11.x and 83ea1d22bf to 11.0.x and 6e78beed9e to 10.4.x and 80b88cf280 to 10.3.x. Thanks!
Comment #32
bronismateusz commentedIt seems that the problem still exists in Drupal 11.1.6:

Comment #33
finnsky commented@bronismateusz
Hello!
on the screenshot I see Gin theme. The error repeats in Claro?
Gin has own JS as far as i understand https://git.drupalcode.org/project/gin/-/blob/4.0.x/js/navigation/naviga...