list: Fix to set_selected_index when List up, down to select item. (#398)

This commit is contained in:
Jason Lee 2024-11-06 18:44:10 +08:00 committed by GitHub
parent 8c3997d795
commit 270493f3ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -284,6 +284,7 @@ where
self.selected_index = Some(self.delegate.items_count(cx) - 1);
}
self.delegate.set_selected_index(self.selected_index, cx);
self.scroll_to_selected_item(cx);
cx.notify();
}
@ -303,6 +304,7 @@ where
self.selected_index = Some(0);
}
self.delegate.set_selected_index(self.selected_index, cx);
self.scroll_to_selected_item(cx);
cx.notify();
}