Skip to content

Commit

Permalink
A follow up to #54773 (#54846)
Browse files Browse the repository at this point in the history
When a search box has an expandable input field and is in "button only" mode, provide a max-width for the button and take away 100px when the form is expanded to avoid text wrapping and overflow in narrow viewport widths.
When the search form is collapsed revert to max-width of 100% to ensure the button fills its container. The input is not there so we don't need the 100px.
  • Loading branch information
ramonjd committed Sep 27, 2023
1 parent c1fba86 commit 931efb0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/block-library/src/search/style.scss
Expand Up @@ -55,11 +55,12 @@ $button-spacing-y: math.div($grid-unit-15, 2); // 6px
margin-left: 0;
// Prevent unintended text wrapping.
flex-shrink: 0;
// Ensure minimum input field width in small viewports.
max-width: 100%;
}

// Ensure minimum input field width in small viewports.
.wp-block-search__button[aria-expanded="true"] {
max-width: calc(100% - 100px);
&.has-icon {
max-width: 100%;
}
}
}

Expand Down

0 comments on commit 931efb0

Please sign in to comment.