number_input_story: Fix subtraction overflow (#976)
This commit is contained in:
parent
a478f000d4
commit
c39e7af50c
1 changed files with 1 additions and 1 deletions
|
|
@ -155,7 +155,7 @@ impl NumberInputStory {
|
|||
input.set_value(self.number_input1_value.to_string(), window, cx);
|
||||
});
|
||||
} else if this == &self.number_input2 {
|
||||
self.number_input2_value = self.number_input2_value - 1;
|
||||
self.number_input2_value = self.number_input2_value.saturating_sub(1);
|
||||
this.update(cx, |input, cx| {
|
||||
input.set_value(self.number_input2_value.to_string(), window, cx);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue