[WIP][Windows] Fix Entry.Completed firing during IME candidate confirmation#36577
[WIP][Windows] Fix Entry.Completed firing during IME candidate confirmation#36577HarishwaranVijayakumar wants to merge 3 commits into
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36577Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36577" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
| handler.PlatformView.Focus(Microsoft.UI.Xaml.FocusState.Programmatic); | ||
| await Task.Delay(100); | ||
|
|
||
| SimulateIMECandidateEnter(handler.PlatformView); |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[moderate] Regression Prevention and Test Coverage — This negative test can pass without exercising the Entry handler because the injected key is global and the test never verifies that the TextBox actually received keyboard input. If Focus(...) fails or input injection is not routed to this PlatformView, completedCount stays 0 for the wrong reason. Please assert the focus/precondition and add a positive control (for example, inject a normal Enter KeyDown+KeyUp and verify Completed fires) before relying on the KeyUp-only IME simulation.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details
Root Cause of the issue
Description of Change
IME Enter key handling improvements:
_enterKeyDownSeenflag and updated the key event logic inEntryHandler.Windows.csto suppress theCompletedevent when Enter is used to confirm an IME candidate, ensuring it only fires on actual user submissions.Testing:
SimulateIMECandidateEntermethod and a new test,CompletedDoesNotFireOnIMECandidateEnter, inEntryHandlerTests.Windows.csto simulate the IME candidate confirmation scenario and verify that theCompletedevent is not triggered.Issues Fixed
Fixes #36179
Tested the behaviour in the following platforms
Beforefix-36179.mp4
Afterfix-36179.mp4