Skip to content

Commit

Permalink
Correcting the non inclusion of the uper bound in number input
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultraxime committed Jul 23, 2024
1 parent 000d93e commit f9490f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/widgets/number_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,15 +503,15 @@ where
if new_val.is_empty() {

Check failure on line 503 in src/widgets/number_input.rs

View workflow job for this annotation

GitHub Actions / all

Diff in /home/runner/work/iced_aw/iced_aw/src/widgets/number_input.rs
new_val = T::zero().to_string();
}

match T::from_str(&new_val) {
Ok(val)
if (self.min..self.max).contains(&val) && val != self.value =>
if val >= self.min && val <= self.max && val != self.value =>
{
self.value = val;
forward_to_text(event, shell, child, clipboard)
}
Ok(val) if (self.min..self.max).contains(&val) => {
Ok(val) if val >= self.min && val <= self.max => {
forward_to_text(event, shell, child, clipboard)
}
Ok(_) => event::Status::Captured,
Expand Down Expand Up @@ -547,12 +547,12 @@ where

match T::from_str(&new_val) {
Ok(val)
if (self.min..self.max).contains(&val) && val != self.value =>
if val >= self.min && val <= self.max && val != self.value =>
{
self.value = val;
forward_to_text(event, shell, child, clipboard)
}
Ok(val) if (self.min..self.max).contains(&val) => {
Ok(val) if val >= self.min && val <= self.max => {
forward_to_text(event, shell, child, clipboard)
}
Ok(_) => event::Status::Captured,
Expand Down

0 comments on commit f9490f2

Please sign in to comment.