fix(segmented_button): model index out of bounds when setting position
This commit is contained in:
parent
b80d90e5ce
commit
d536341234
1 changed files with 2 additions and 1 deletions
|
|
@ -355,9 +355,10 @@ where
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.order.remove(index as usize);
|
||||||
|
|
||||||
let position = self.order.len().min(position as usize);
|
let position = self.order.len().min(position as usize);
|
||||||
|
|
||||||
self.order.remove(index as usize);
|
|
||||||
self.order.insert(position, id);
|
self.order.insert(position, id);
|
||||||
Some(position)
|
Some(position)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue