Skip to content

Commit

Permalink
Fix bug with "flex" element not settings their box.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurSonzogni committed Dec 25, 2024
1 parent d7ac14a commit d907fe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ftxui/component/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class VerticalContainer : public ContainerBase {
return false;
}

int old_selected = *selector_;
if (event.mouse().button == Mouse::WheelUp) {
MoveSelector(-1);
}
Expand All @@ -171,7 +172,7 @@ class VerticalContainer : public ContainerBase {
}
*selector_ = std::max(0, std::min(int(children_.size()) - 1, *selector_));

return true;
return old_selected != *selector_;
}

Box box_;
Expand Down
1 change: 1 addition & 0 deletions src/ftxui/dom/flex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Flex : public Node {
}

void SetBox(Box box) override {
Node::SetBox(box);
if (children_.empty()) {
return;
}
Expand Down

0 comments on commit d907fe4

Please sign in to comment.