Fix: Forward gridbox selected box. (#408)

This was discovered in:
https://github.com/ArthurSonzogni/FTXUI/issues/407
This commit is contained in:
Arthur Sonzogni
2022-05-28 22:35:52 +02:00
committed by GitHub
parent 219daf46ff
commit ed5b4cec49
5 changed files with 69 additions and 28 deletions

View File

@@ -596,6 +596,25 @@ TEST(GridboxTest, MissingCells) {
" ");
}
TEST(GridboxTest, Focus) {
auto root = gridbox({
{cell("1"), cell("2"), cell("3"), cell("4")},
{cell("5"), cell("6"), cell("7"), cell("8")},
{cell("9"), cell("10"), cell("11"), cell("12")},
{cell("13"), cell("14") | focus, cell("15"), cell("16")},
{cell("17"), cell("18"), cell("19"), cell("20")},
});
root |= frame;
Screen screen(4, 3);
Render(screen, root);
EXPECT_EQ(screen.ToString(),
"╭──╮\r\n"
"│14│\r\n"
"╰──╯");
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.