diff --git a/.changeset/spicy-jeans-deliver.md b/.changeset/spicy-jeans-deliver.md new file mode 100644 index 0000000000..80c343eca8 --- /dev/null +++ b/.changeset/spicy-jeans-deliver.md @@ -0,0 +1,5 @@ +--- +"svelte": patch +--- + +fix: ensure inspect fires on prop changes diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 1fe72efa41..cf55be1f5e 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -1646,7 +1646,8 @@ export function prop(props, key, flags, initial) { var current = get(current_value); // legacy nonsense — need to ensure the source is invalidated when necessary - if (is_signals_recorded) { + // also needed for when handling inspect logic so we can inspect the correct source signal + if (is_signals_recorded || (DEV && inspect_fn)) { // set this so that we don't reset to the parent value if `d` // is invalidated because of `invalidate_inner_signals` (rather // than because the parent or child value changed)