Skip to content

[2.x] style: hide search clear button when collapsed in tablet mode#4594

Merged
imorland merged 1 commit intoflarum:2.xfrom
huoxin233:huoxin/2.x-overlap-icon-in-search-bar
Apr 20, 2026
Merged

[2.x] style: hide search clear button when collapsed in tablet mode#4594
imorland merged 1 commit intoflarum:2.xfrom
huoxin233:huoxin/2.x-overlap-icon-in-search-bar

Conversation

@huoxin233
Copy link
Copy Markdown
Contributor

Fixes #4593

Changes proposed in this pull request:

In tablet mode, if the search state retains a value, the Input component still renders the .Input-clear button, causing it to visually overlap with the search prefix icon.

This PR adds a CSS rule using the sibling selector input:not(:focus) ~ .Input-clear within the existing tablet media query to hide the clear button when the input is collapsed.

Reviewers should focus on:

Screenshot

Before:

PixPin_2026-04-20_23-17-29.mp4

After:

PixPin_2026-04-21_01-18-44.mp4

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)

@imorland imorland merged commit 655b022 into flarum:2.x Apr 20, 2026
19 checks passed
@huoxin233 huoxin233 deleted the huoxin/2.x-overlap-icon-in-search-bar branch April 21, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.x] Icon overlap in search bar and cancel button always open search modal

2 participants