Fix picker item width overflow

Fixes #352
This commit is contained in:
Gokul Soumya 2021-06-23 20:38:08 +05:30 committed by Blaž Hrastnik
parent 2924522aea
commit fb8e7dc25b

View file

@ -293,7 +293,7 @@ fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
inner.x + 3,
inner.y + 2 + i as u16,
(self.format_fn)(option),
inner.width as usize - 1,
(inner.width as usize).saturating_sub(3), // account for the " > "
if i == (self.cursor - offset) {
selected
} else {