Do not load CodexTypeaheadSearch styles on page load

Move CdxTypeaheadSearch out of render blocking module - it is not
needed - only CdxSearchInput is rendered by default.

Bug: T378636
Change-Id: Id4feb26f73413826cf04ec200d0d501c6b057bfc
This commit is contained in:
Jon Robson 2024-10-30 11:23:45 -07:00 committed by Jdlrobson
parent 14f42dd971
commit fc8513e61a
2 changed files with 6 additions and 2 deletions

View file

@ -13,6 +13,12 @@
}
@media ( min-width: @min-width-breakpoint-desktop-wide ) {
// The CodexTypeaheadSearch when loaded will introduce a margin.
// To avoid a reflow of the UI, we duplicate this code here.
.client-js .cdx-typeahead-search--auto-expand-width {
margin-left: @size-search-expand;
}
.client-js & .vector-search-box.vector-search-box-auto-expand-width {
// Ensure search box is aligned with content when it autoexpands (i.e. search thumbnails)
margin-left: -@size-search-expand;

View file

@ -211,7 +211,6 @@
"class": "MediaWiki\\ResourceLoader\\CodexModule",
"codexStyleOnly": true,
"codexComponents": [
"CdxTypeaheadSearch",
"CdxSearchInput",
"CdxButton",
"CdxRadio",
@ -223,7 +222,6 @@
"skins.vector.search.codex.styles"
],
"class": "MediaWiki\\ResourceLoader\\CodexModule",
"codexScriptOnly": true,
"codexComponents": [
"CdxTypeaheadSearch"
]