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 Increment and Decrement Set the Value After Validation #1016

Open
c0nstexpr opened this issue Mar 25, 2024 · 0 comments
Open

NumberBox Increment and Decrement Set the Value After Validation #1016

c0nstexpr opened this issue Mar 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@c0nstexpr
Copy link

Describe the bug

Increment and decrement button in NumberBox invoke StepValue function.
It validates input before increment or decrement.

        // Before adjusting the value, validate the contents of the textbox so we don't override it.
        ValidateInput();

        var newValue = Value ?? 0;

        if (change is not null)
        {
            newValue += change ?? 0d;        // <--------- increment or drcement happens here
        }

        SetCurrentValue(ValueProperty, newValue);        // <--------- value set here

To Reproduce

Use NumberBox with max and min range set. Click increment or decrement button to set the value out of range.

Expected behavior

Value should not be set out of range

Screenshots

No response

OS version

Same as repo

.NET version

Same as repo

WPF-UI NuGet version

Same as repo

Additional context

No response

@c0nstexpr c0nstexpr added the bug Something isn't working label Mar 25, 2024
@c0nstexpr c0nstexpr mentioned this issue Jun 5, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant