Open jeromelaban opened 5 years ago
I gave a look at this one.
Using the following code:
private void DisableOnf_BeforeTextChanging(TextBox sender, TextBoxBeforeTextChangingEventArgs args)
{
LogTextBlock.Text += $"\nEntered BeforeTextChanging. IsEnabled: {sender.IsEnabled}, NewText: {args.NewText}";
//if (!sender.IsEnabled)
//{
// args.Cancel = true;
//}
if (args.NewText.EndsWith("f"))
{
args.Cancel = true;
sender.IsEnabled = false;
}
}
The test still fails, and logs shows the following:
This suggests that the commented out condition is always false and is redundant, right?
Hmmm... Uncomment it, now the test passes. @MartinZikmund Any guess on what can be going here? I don't like adding such a seemingly redundant check to close the issue. Feels very hacky and this might be effectively "hiding" some bug elsewhere.
Note that in the screenshot, the text became "Catish" while DisableOnf_BeforeTextChanging
was never called with such text.
This feels like the even is raised incorrectly, indeed. What does lead to that event being raised in the wrong conditions?
Expected behavior
The test passes.
How to reproduce it (as minimally and precisely as possible)
Run this test: https://github.com/unoplatform/uno/blob/59a911c4d1eeecfa709217f2e2b7430aea0251b8/src/SamplesApp/SamplesApp.UITests/UnoSamples_Tests.Keyboard.cs#L391
Environment
Nuget Package:
Package Version(s):
Affected platform(s):
Visual Studio
Relevant plugins
Anything else we need to know?
Infinite AutoRetry for WASM