Skip to content

Commit ef6ee79

Browse files
committed
fix(dccd): fix for notified Map & List
When Map or List changes are reported, we should check them one more time to make isDirty false. Before this change the mode would be set to _MODE_NOOP_ right after a change is notified which causes the Map / List to be in a dirty state.
1 parent 26387cb commit ef6ee79

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/change_detection/dirty_checking_change_detector.dart

+6-4
Original file line numberDiff line numberDiff line change
@@ -583,13 +583,15 @@ class DirtyCheckingRecord<H> implements Record<H>, WatchRecord<H> {
583583
_mode = _MODE_NOOP_;
584584
break;
585585
case _MODE_MAP_NOTIFIED_:
586-
_mode = _MODE_NOOP_; // no-op until next notification
587-
return (currentValue as _MapChangeRecord)._check(object);
586+
var dirty = (currentValue as _MapChangeRecord)._check(object);
587+
if (!dirty) _mode = _MODE_NOOP_;
588+
return dirty;
588589
case _MODE_MAP_:
589590
return (currentValue as _MapChangeRecord)._check(object);
590591
case _MODE_LIST_NOTIFIED_:
591-
_mode = _MODE_NOOP_; // no-op until next notification
592-
return (currentValue as _CollectionChangeRecord)._check(object);
592+
var dirty = (currentValue as _CollectionChangeRecord)._check(object);
593+
if (!dirty) _mode = _MODE_NOOP_;
594+
return dirty;
593595
case _MODE_ITERABLE_:
594596
return (currentValue as _CollectionChangeRecord)._check(object);
595597
default:

0 commit comments

Comments
 (0)