Skip to content

Commit 875d9a3

Browse files
committed
marking the document as dirty when _minInvalidChildIndex is changing
1 parent b9e2ad7 commit 875d9a3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/@react-aria/collections/src/Document.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export class BaseNode<T> {
105105
private invalidateChildIndices(child: ElementNode<T>): void {
106106
if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
107107
this._minInvalidChildIndex = child;
108+
this.ownerDocument.markDirty(this);
108109
}
109110
}
110111

@@ -481,12 +482,6 @@ export class Document<T, C extends BaseCollection<T> = BaseCollection<T>> extend
481482
}
482483

483484
// Next, update dirty collection nodes.
484-
// TODO: when updateCollection is called here, shouldn't we be calling this.updateChildIndicies as well? Theoretically it should only update
485-
// nodes from _minInvalidChildIndex onwards so the increase in dirtyNodes should be minimal.
486-
// Is element.updateNode supposed to handle that (it currently assumes the index stored on the node is correct already).
487-
// At the moment, without this call to updateChildIndicies, filtering an async combobox doesn't actually update the index values of the
488-
// updated collection...
489-
this.updateChildIndices();
490485
for (let element of this.dirtyNodes) {
491486
if (element instanceof ElementNode) {
492487
if (element.isConnected && !element.isHidden) {

0 commit comments

Comments
 (0)