mirror of https://github.com/sveltejs/svelte
fix: SvelteURL search setter uses unnormalized value (#17828)
## Summary - The `SvelteURL` `search` setter stored the raw input `value` instead of `super.search`, unlike every other setter in the class - This caused `url.search` to return incorrect values when the URL API normalizes the input (e.g. adding the `?` prefix, or stripping a lone `?`) - For example: `url.search = 'foo=bar'` would return `'foo=bar'` instead of `'?foo=bar'` ## Test plan - [x] Added `url.search normalizes value` test covering: - Setting search without `?` prefix - Setting search with `?` prefix (existing behavior) - Setting search to lone `?` (normalized to `""`) - [x] All existing reactivity tests pass (46/46) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>pull/17812/head
parent
6e9b2a6fd8
commit
361b32c7cd
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: SvelteURL `search` setter now returns the normalized value, matching native URL behavior
|
||||
Loading…
Reference in new issue