Skip to content

Commit d36d452

Browse files
authored
fix(controls): NumberBox need validating new value after applying step change value
Co-authored-by: <kezg@bciflex.com>
1 parent 40f1e37 commit d36d452

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Wpf.Ui/Controls/NumberBox/NumberBox.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,11 @@ private void StepValue(double? change)
421421
newValue += change ?? 0d;
422422
}
423423

424-
SetCurrentValue(ValueProperty, newValue);
424+
// After adding step value, validate new value is between Minimum and Maximum
425+
if (newValue >= Minimum && newValue <= Maximum)
426+
{
427+
SetCurrentValue(ValueProperty, newValue);
428+
}
425429

426430
MoveCaretToTextEnd();
427431
}

0 commit comments

Comments
 (0)