fix(AutoComplete): make close button functional#1860
Open
taufeeq31 wants to merge 1 commit intoRocketChat:mainfrom
Open
fix(AutoComplete): make close button functional#1860taufeeq31 wants to merge 1 commit intoRocketChat:mainfrom
taufeeq31 wants to merge 1 commit intoRocketChat:mainfrom
Conversation
|
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.
Proposed changes (including videos or screenshots)
This PR fixes the non-functional close/clear button in the
AutoCompletecomponent. Previously, the icon would switch to a 'cross' when the menu was open, but clicking it had no effect.Changes:
handleClearfunction that clears the filter text, resets the selected value, and closes the dropdown.onClickto trigger the clear action when the menu is visible, and focus the input when it is not.onMouseDownprevention to the Icon to stop the input from blurring before the click is registered.Demo
Screen.Recording.2026-02-06.at.11.24.33.PM.mov
Issue(s)
Closes #1296
Note on remaining behavior:
There is a small flicker in the dropdown when the clear button is clicked, likely due to event propagation and a brief re-render. This PR focuses only on making the close button functional.