Just pulled the latest 11.x so I could checkout the top bar.
Drupal.displace() is not running on the sidebar anymore. I checked 11.1, and it it works great there.
Doing a bit of debugging, and it looks like the JS can't find the displace element to add the appropriate attribute to.

| Comment | File | Size | Author |
|---|---|---|---|
| NeonByte_Home_Page___Drush_Site-Install.png | 71.75 KB | mherchel |
Issue fork drupal-3526180
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:
- 3526180-regression-drupal.displace-not
changes, plain diff MR !12209
Comments
Comment #5
mherchelFix attached.
Comment #6
godotislateThe build job https://git.drupalcode.org/issue/drupal-3526180/-/jobs/5344144 failed, which is probably an intermittent failure and just needs a re-run.
Other than that, looks like there's an existing Nightwatch test for displace behavior in core/tests/Drupal/Nightwatch/Tests/jsDisplace.js and there are navigation Nightwatch tests in core/modules/navigation/tests/src/Nightwatch/Tests/. I think there probably should be a Nightwatch test for displace + navigation? Not completely familiar with how those tests work.
Comment #7
mherchelYeah the current tests passed when I re-ran them.
Just pushed a simple nightwatch test. Lets see if this passes (I didn't test it locally 😬🤞)
Comment #8
mherchelYay! Test is passing. Note that I don't test out displace's functionality (that gets tested in its respective tests), I just test that the attribute is added properly, which is what the JS in this module does.
Comment #9
godotislateLooks like the regression might have come from #3504722: Navigation Expand/Collapse logic is not working properly in conjunction with Big Pipe.
Since
initDisplace()is moved outside a behavior, with Big Pipe enabled, it's possible that initDisplace() is called before the.admin-toolbarelement is in the DOM and hencedata-offset-${edge}does not get added.Moving the call to
initDisplace()inside a behavior means that at some point the context passed to the behavior will contain.admin-toolbar, so the offset attribute gets added to the element.Nightwatch test confirms that the
data-offset-leftattribute gets added correctly, and I think it's safe to assume in the test that the direction is 'left'.lgtm.
Comment #10
godotislateComment #11
godotislateMissed that the MR should be against 11.x. Right now it's against 11.2.x.
Comment #12
mherchelFixing now
Comment #13
mherchelOK. Should be good!
Comment #15
nod_Committed and pushed 5aa1596bdc3 to 11.x and 19df4f1774c to 11.2.x. Thanks!
Comment #18
nod_