Skip to content

Commit 1b56a32

Browse files
authored
fix: ensure inspect fires on prop changes (#10468)
* fix: ensure inspect fires on prop changes * fix: ensure inspect fires on prop changes * fix: ensure inspect fires on prop changes
1 parent 9129d2f commit 1b56a32

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/spicy-jeans-deliver.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: ensure inspect fires on prop changes

packages/svelte/src/internal/client/runtime.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,8 @@ export function prop(props, key, flags, initial) {
16461646
var current = get(current_value);
16471647

16481648
// legacy nonsense — need to ensure the source is invalidated when necessary
1649-
if (is_signals_recorded) {
1649+
// also needed for when handling inspect logic so we can inspect the correct source signal
1650+
if (is_signals_recorded || (DEV && inspect_fn)) {
16501651
// set this so that we don't reset to the parent value if `d`
16511652
// is invalidated because of `invalidate_inner_signals` (rather
16521653
// than because the parent or child value changed)

0 commit comments

Comments
 (0)