Project

General

Profile

Bug #10238

The tristate checkbox updates its state too late after being clicked

Added by Andreas Frolov 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/25/2022
Due date:
% Done:

0%

Estimated time:

Description

here is a small example:

auto layout = std::make_unique<Wt::WVBoxLayout>();
auto cb =  layout->addWidget(std::make_unique<Wt::WCheckBox>("Tristate"));
cb->setPartialStateSelectable(true);
cb->clicked().connect([cb]() {
  Wt::log("info") << "WCheckBox checked1: " << (int)cb->isChecked();
  Wt::log("info") << "WCheckBox checkState1: " << (int)cb->checkState();
  Wt::WTimer::singleShot(std::chrono::milliseconds(0), [cb]() {
    Wt::log("info") << "WCheckBox checked2: " << (int)cb->isChecked();
    Wt::log("info") << "WCheckBox checkState2: " << (int)cb->checkState();
  });
});

The first four clicks can be ignored because the state order is not correct (s. Bug #10211). But then the states only match when changing from checked to unchecked.

No data to display

Also available in: Atom PDF