Skip to content
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

[NumberBox] Binding, TwoWay, LostFocust changes the value before losing focus #9562

Open
AndrewKeepCoding opened this issue Apr 19, 2024 · 1 comment
Labels
area-Binding area-NumberBox NumberBox Control bug Something isn't working team-Controls Issue for the Controls team

Comments

@AndrewKeepCoding
Copy link
Contributor

Describe the bug

NumberBox with Binding as the following code, when operated by mouse scrolling or UP/Down keys, changes the bound value BEFORE the focus is lost.

<NumberBox Value="{Binding DoubleValue, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />

NumberBox with x:Bind, changes the bound value AFTER the focus is lost.

<NumberBox Value="{x:Bind ViewModel.DoubleValue, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />

I understand that xBind the recommended way to do bindings, but I need to use Binding in a DataTemplate when the target data type is unknown.

Steps to reproduce the bug

Use this test app in my repo.

Expected behavior

NumberBox, with the following code, changes the value AFTER the focus is lost.

<NumberBox Value="{Binding DoubleValue, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.2: 1.5.240404000

Windows version

No response

Additional context

CheckBox works as expected.

<CheckBox IsChecked="{x:Bind ViewModel.BoolValue, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
<CheckBox IsChecked="{Binding BoolValue, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
@AndrewKeepCoding AndrewKeepCoding added the bug Something isn't working label Apr 19, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Apr 19, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@AndrewKeepCoding AndrewKeepCoding changed the title [NumberBox] Binding, TwoWay, LostFocust changes the value before losing focus [NumberBox] Binding, TwoWay, LostFocust changes the value before losing focus Apr 19, 2024
@codendone codendone added area-NumberBox NumberBox Control area-Binding team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Binding area-NumberBox NumberBox Control bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

2 participants