Scroll down to reveal the selected item after expanding pager

This commit is contained in:
Simon Börjesson 2024-02-06 21:18:40 +01:00 committed by Johannes Altmanninger
parent 47aa79813d
commit d51ecb7fb3

View file

@ -798,7 +798,10 @@ impl Pager {
// Ensure our suggested row start is not too early before it.
if self.suggested_row_start + visible_row_count <= row_containing_selection {
// The user moved south past the bottom completion.
if !self.fully_disclosed && rendering.remaining_to_disclose > 0 {
if matches!(direction, SelectionMotion::South | SelectionMotion::East)
&& !self.fully_disclosed
&& rendering.remaining_to_disclose > 0
{
self.fully_disclosed = true; // perform disclosure
} else {
// Scroll