ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.73k stars 401 forks source link

Scroll a menu when full #191

Closed DavidLazarescu closed 3 years ago

DavidLazarescu commented 3 years ago

Hey, i got the problem that i have a menu, which has more elements than it can represent in its space. Is there a way to make the menu scrollable? So for example when i m at the last element and press the ARROW-DOWN key, the menu scrolls the contents one up, so i can always see the last element i am currently selecting? Currently it looks like this: https://streamable.com/k51uqc

As you can see, its just continuing out of screen size (When i fix the size of the menu with: ftxui::size(ftxui::HEIGHT, ftxui::LESS_THAN, 20) It doesnt scroll either, i can still select the lower notes, but i can not see which one is currently selected.

Thanks in advance

ArthurSonzogni commented 3 years ago

Do you have tried: frame and variant: xframe?

See for instance the example: https://arthursonzogni.com/FTXUI/examples/?file=component/checkbox_in_frame https://arthursonzogni.github.io/FTXUI/namespaceftxui.html#ad0d6a96f6e1fb6d67d9fa6323062a737 and you can replace the checkbox by a menu.

DavidLazarescu commented 3 years ago

Thanks! it works perfectly