You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say we have a vertical split and both top and bottom components are of Container::Vertical type.
If we added some child components which are Container::Vertical / Container::Horizontal themselves to the top or bottom parent components, the current scroll position resets to 0 when the parent component is not focused.
Here is the simple reproducer:
#include<random>
#include<algorithm>
#include<ftxui/dom/elements.hpp>
#include<ftxui/screen/screen.hpp>
#include<ftxui/component/component.hpp>
#include<ftxui/component/component_base.hpp>
#include<ftxui/component/event.hpp>
#include<ftxui/component/mouse.hpp>
#include<ftxui/component/screen_interactive.hpp>
#include<ftxui/dom/canvas.hpp>
#include<ftxui/screen/color.hpp>
#include<string>usingnamespaceftxui;intmain()
{
int size = 40;
int size2 = 40;
auto top_comp = Container::Vertical({});
auto bottom_comp = Container::Vertical({});
bottom_comp->Add(Button("exit", []{}));
for (int i = 0; i < 30; i++)
{
if (i % 2 == 0)
{
top_comp->Add(Button("Button #" + std::to_string(i), []{}));
}
else
{
auto hor_button_comp = Container::Horizontal({
Button("Button #" + std::to_string(i), []{}),
Button("nottuB #" + std::to_string(i * 2), []{}),
});
top_comp->Add(hor_button_comp);
}
}
auto rendered_top_comp = Renderer(top_comp, [&] {
return top_comp->Render() | vscroll_indicator | hscroll_indicator | frame;
});
auto vert_split_comp = ResizableSplitTop(rendered_top_comp, bottom_comp, &size2);
auto right_comp = Container::Horizontal({});
right_comp->Add(Button("right split button 1", []{}));
right_comp->Add(Button("right split button 2", []{}));
auto hor_split_comp = ResizableSplitRight(right_comp, vert_split_comp, &size);
auto screen = ftxui::ScreenInteractive::Fullscreen();
screen.Loop(hor_split_comp);
}
That's not happening when child component is not a container itself (Button for example).
I've tried to capture the problem:
When i move the focus from Nottub #30 button to right split button, the vertical scroller moves all the way to the top. That's not happening if top_comp consists of Button components only. The scroller stays in place.
The text was updated successfully, but these errors were encountered:
Let's say we have a vertical split and both top and bottom components are of
Container::Vertical
type.If we added some child components which are
Container::Vertical / Container::Horizontal
themselves to the top or bottom parent components, the current scroll position resets to 0 when the parent component is not focused.Here is the simple reproducer:
That's not happening when child component is not a container itself (
Button
for example).I've tried to capture the problem:
When i move the focus from
Nottub #30
button toright split button
, the vertical scroller moves all the way to the top. That's not happening iftop_comp
consists ofButton
components only. The scroller stays in place.The text was updated successfully, but these errors were encountered: