Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ScrollView on LinearLayout with Dialog doesn't scroll properly #813

Open
1uigii opened this issue Mar 7, 2025 · 0 comments
Open
Labels

Comments

@1uigii
Copy link

1uigii commented Mar 7, 2025

Describe the bug
The ScrollView doesn't follow the Dialog boxes properly. This is especially noticeable when adding a button to the Dialog boxes. The last boxes (usually the last 33%) can't even be scrolled to.

To Reproduce

use cursive::{
    view::{Resizable, Scrollable},
    views,
};

fn main() {
    let mut root = cursive::crossterm();

    let mut list = views::LinearLayout::vertical();

    for i in 1..=50 {
        list.add_child(views::Dialog::text(format!("Some dialog ({i:>02})")))
    }

    let list = list.scrollable().fixed_size((70, 50));

    root.add_layer(list);

    root.run();
}

Expected behavior
Every Dialog box should be visible when scrolling.

Screenshots
Image

Environment

  • Windows 11
  • Backend used: crossterm
  • LANG=
  • LC_CTYPE="C.UTF-8"
  • LC_NUMERIC="C.UTF-8"
  • LC_TIME="C.UTF-8"
  • LC_COLLATE="C.UTF-8"
  • LC_MONETARY="C.UTF-8"
  • LC_MESSAGES="C.UTF-8"
  • LC_ALL=
  • Cursive version 0.21.1 (also tested with the latest master)

Additional context
It does not seem to be a problem with uniquely sized Views, but with Dialogs in particular, as it works with Panel, or LinearLayout (instead of Dialog) without problem.

@1uigii 1uigii added the bug label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant