Skip to content

Conversation

@dipeshmsft
Copy link
Member

Addresses #5444
This is a port of a servicing fix in .NET 4.7-4.8.

Description

A binding on TextBox.Text defers two kinds of work when an IME composition is in progress on the TextBox:

When the text changes (and UpdateTrigger=PropertyChanged), write a new value into the source property.
After writing a value into the source property, read the property's new value (which might be different), apply the customary conversions, and write the result into the TextBox.
The bug occurs when the IME starts a new composition before the previous composition's type 2 work happens. This yields a situation where two tasks are deferred: the older composition's type 2 task and the newer composition's type 1 task. The type 2 task happens first, overwriting the text change that the type 1 task is supposed to handle. This confusion of state leads to exceptions (caught and hidden from the IME, but visible in the debugger), and unexpected content entered into the TextBox.

Fixed by cancelling any pending type 2 work when new type 1 work is needed.

Customer Impact

Input with certain IMEs (e.g. MS Quick) is broken.

Regression

No.

Testing

Ad-hoc around customer scenario.
Standard regression testing.

Risk

Low. Port of a .NETFx servicing fix released earlier this year.

@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Jan 27, 2022
@ghost ghost requested review from SamBent, fabiant3 and ryalanms January 27, 2022 12:10
@leecow leecow added this to the 3.1.24 milestone Feb 3, 2022
@dipeshmsft dipeshmsft merged commit af7c767 into dotnet:release/3.1 Feb 7, 2022
@dipeshmsft dipeshmsft deleted the pr5840-3.1 branch March 14, 2022 02:27
@ghost ghost locked as resolved and limited conversation to collaborators Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage Servicing-approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants