mirror of https://github.com/sveltejs/svelte
fix: correct migration of uninitialised state (#13673)
* fix: correct migration of uninitialised state * better fixpull/13678/head
parent
0598f2bbe1
commit
f398929fdd
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: correct migration of uninitialised state
|
@ -0,0 +1,13 @@
|
||||
<script lang="ts">
|
||||
let bounds: DOMRect | undefined;
|
||||
$: position = calculatePosition(bounds);
|
||||
|
||||
const openDropdown = () => {
|
||||
bounds = getInputPosition();
|
||||
};
|
||||
|
||||
const getInputPosition = () => {};
|
||||
const calculatePosition = (boundary?: DOMRect) => ({});
|
||||
</script>
|
||||
|
||||
<div style:top={position.top}></div>
|
@ -0,0 +1,13 @@
|
||||
<script lang="ts">
|
||||
let bounds: DOMRect | undefined = $state();
|
||||
|
||||
const openDropdown = () => {
|
||||
bounds = getInputPosition();
|
||||
};
|
||||
|
||||
const getInputPosition = () => {};
|
||||
const calculatePosition = (boundary?: DOMRect) => ({});
|
||||
let position = $derived(calculatePosition(bounds));
|
||||
</script>
|
||||
|
||||
<div style:top={position.top}></div>
|
Loading…
Reference in new issue