Problem/Motivation

Found when double checking some CSS loading things, didn't find anything from those but discovered this by accident instead.

Steps to reproduce

Turn of js aggregation.

Load the front page of Standard, logged out, with chrome performance profiling.

Look for style recalculations - you'll find one triggered by search.js

It adds an aria-expanded="false" attribute to search-wide, but that's the default when the page is loaded anyway, so we can add that in the template then it won't change on page load, only when the visibility is actually toggled.

Proposed resolution

Preload aria-expanded="false" to the template

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#5 Screenshot from 2026-01-18 09-17-58.png140.29 KBcatch

Issue fork drupal-3567983

Command icon 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:

Comments

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review
catch’s picture

Title: Olivero search.js causes unnecessary style recalculation » Avoid unnecessary style recalculation from Olivero search

Re-titling since this doesn't actually change the js at all, just adds a default in the markup that matches the state the js will set anyway on page load.

dcam’s picture

Status: Needs review » Active

Did you forget to push the changes? I pulled the issue branch and rebased it, but there's no diff with main.

catch’s picture

Status: Active » Needs review
StatusFileSize
new140.29 KB

I did forget... MR up now.

Also attaching a screenshot of what the stylesheet recalculation looks like in chrome performance profile.

catch’s picture

While I was double checking this prior to making the MR, found another one #3568141: Try to avoid style recalculation in Olivero's isDesktopNav.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Seems like a straight forward fix, since this is Olivero only assuming we don't need a CR for the twig change.

  • nod_ committed 019f7731 on 11.3.x
    task: #3567983 Avoid unnecessary style recalculation from Olivero search...

  • nod_ committed 3cb92c2c on 11.x
    task: #3567983 Avoid unnecessary style recalculation from Olivero search...

  • nod_ committed 54944f5f on main
    task: #3567983 Avoid unnecessary style recalculation from Olivero search...
nod_’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 54944f5faaa to main and 3cb92c2c1a8 to 11.x and 019f773107d to 11.3.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.