Skip to content

Commit 2cc1649

Browse files
committed
replace changeType: Send updates to parent and replaced node
1 parent 84b854e commit 2cc1649

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/LiveViewNative/Coordinators/LiveViewCoordinator.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,17 @@ public class LiveViewCoordinator<R: RootRegistry>: ObservableObject {
315315
case let .nodeElement(element):
316316
// when a single element changes, send an update only to that element.
317317
switch patch.changeType {
318-
case .add, .remove, .replace:
318+
case .add, .remove:
319319
if let parent = patch.parent {
320320
self?.elementChanged(parent).send()
321321
} else {
322322
self?.elementChanged(patch.node).send()
323323
}
324+
case .replace:
325+
if let parent = patch.parent {
326+
self?.elementChanged(parent).send()
327+
}
328+
self?.elementChanged(patch.node).send()
324329
case .change:
325330
self?.elementChanged(patch.node).send()
326331
}

0 commit comments

Comments
 (0)