should not SyncTextAndValue while fromTextToValue and clamp

This commit is contained in:
heartacker
2024-03-21 15:30:53 +08:00
parent c3ed31659b
commit f41d299338

View File

@@ -564,9 +564,16 @@ public abstract class NumericUpDownBase<T> : NumericUpDown where T : struct, ICo
newValue = EmptyInputValue; newValue = EmptyInputValue;
} }
if (!Equals(newValue, Value)) if (!Equals(newValue, Value))
{
if (Equals(Clamp(newValue, Maximum, Minimum), newValue))
{ {
SetCurrentValue(ValueProperty, newValue); SetCurrentValue(ValueProperty, newValue);
} }
else
{
parsedTextIsValid = false;
}
}
} }
catch catch
{ {