mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
Revert "Reduce the amount of re-creation of cells in repeaters when the model changes (#1954)"
This reverts commit 1162ebbb79
.
Because otherwise if we keep the elements, their internal state is kept
and this causes bug #2598
Fixes #2598
This commit is contained in:
parent
0d366e0087
commit
78d273e599
4 changed files with 7 additions and 126 deletions
|
@ -1133,14 +1133,7 @@ public:
|
|||
void ensure_updated(const Parent *parent) const
|
||||
{
|
||||
if (model.is_dirty()) {
|
||||
auto preserved_data = inner ? std::make_optional(std::move(inner->data)) : std::nullopt;
|
||||
inner = std::make_shared<RepeaterInner>();
|
||||
if (auto data = preserved_data) {
|
||||
inner->data = std::move(*data);
|
||||
for (auto &&compo_with_state : inner->data) {
|
||||
compo_with_state.state = RepeaterInner::State::Dirty;
|
||||
}
|
||||
}
|
||||
if (auto m = model.get()) {
|
||||
m->attach_peer(inner);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue