[2.x] fix: prevent search modal from opening when clear button is clicked#4595
Merged
imorland merged 1 commit intoflarum:2.xfrom Apr 20, 2026
Merged
Conversation
8243ae2 to
9af7167
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4593
Changes proposed in this pull request:
The
.Searchdiv inAbstractGlobalSearchhas anonclickhandler that opens the search modal. When the clear button inside theInputcomponent is clicked, the event bubbles up to this handler, causing the search modal to open immediately after clearing the value.This PR adds a guard in theonclickhandler to check if the click originated from within the.Input-clearelement and short-circuit before opening the modal.Found a better solution
This PR modifies the Input component to call
e.stopPropagation()inside the clear button's onclick handler. This will prevent the click from bubbling up to any parent container.Reviewers should focus on:
Screenshot
Before:
PixPin_2026-04-20_23-21-23.mp4
After:
PixPin_2026-04-21_01-19-22.mp4
Necessity
Confirmed
composer test).Required changes: