-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Fix for SearchHandler.Focused and Unfocused event never fires #27577
base: main
Are you sure you want to change the base?
Conversation
Hey there @BagavathiPerumal! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
@dotnet-policy-service terminate |
@dotnet-policy-service agree company="Syncfusion, Inc." |
@@ -275,6 +275,8 @@ void UpdateSearchHandler() | |||
autoSuggestBox.TextChanged += OnSearchBoxTextChanged; | |||
autoSuggestBox.QuerySubmitted += OnSearchBoxQuerySubmitted; | |||
autoSuggestBox.SuggestionChosen += OnSearchBoxSuggestionChosen; | |||
autoSuggestBox.GotFocus += OnSearchBoxGotFocus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we unsubscribe from these events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz, The events are unsubscribed in the DisconnectHandler of ShellItemHandler. Please let me know if you have any other concerns.
…stBox in DisconnectHandler.
Root cause
The root cause of the issue is that the GotFocus and LostFocus events for the AutoSuggestBox control were not previously integrated with the SearchHandler's SetIsFocused method. As a result, the Focused and Unfocused events for the Shell.SearchHandler were not being triggered when the search handler gained or lost focus, leading to incorrect focus management behavior.
Description of Issue Fix
The fix involves connecting the GotFocus and LostFocus events of the AutoSuggestBox control to the SearchHandler's focus management. This is done by adding event handlers for these events in the UpdateSearchHandler method, which will call the SetIsFocused method when the AutoSuggestBox gains or loses focus. This ensures that the Focused and Unfocused events are triggered properly, allowing the search handler to respond when focus changes.
Tested the behavior in the following platforms.
Issues Fixed
Fixes #27551
Output
SearchHandler-BeforeFix.mp4
SearchHandler-AfterFix.mp4