Actions
Bug #6884
closedUnable to pre-hide WContainerWidget that using flexbox layout
Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/06/2019
Due date:
% Done:
0%
Estimated time:
Description
When I supply the layout to the WContainerWidget and call setHidden(true), the WContainerWidget does not hide.
auto widget = root()->addWidget(std::make_unique<Wt::WContainerWidget>());
auto layout = widget->setLayout(std::make_unique<Wt::WVBoxLayout>());
layout->setPreferredImplementation(Wt::LayoutImplementation::Flex);
//The problem is not reproducible with js implementation.
//layout->setPreferredImplementation(Wt::LayoutImplementation::JavaScript);
layout->addWidget(std::make_unique<Wt::WText>("some text."));
widget->setHidden(true);
A workaround is to call a javascript to hide it.
widget->doJavaScript(Wt::WString(R"($("#{1}").hide())").arg(widget->id()).toUTF8());
Updated by Apivan Tuntakurn over 5 years ago
My pull request:
[[[https://github.com/emweb/wt/pull/152]]]
Updated by Roel Standaert over 5 years ago
It looks like it goes a bit deeper than that.
Changing styleDisplay()
like that works fine, and toggling visibility works properly if hiddenKeepGeometry()
is off.
However, we should not set display
to none
when it's on (easy tweak, just add an extra check for that), but it appears that that still breaks toggling visibility.
Updated by Roel Standaert about 5 years ago
- Status changed from Resolved to Closed
Actions