You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
From Stackoverflow [https://stackoverflow.com/questions/58228948/how-do-i-trigger-a-reaction-when-bindthis-is-used-in-await-in-svelte]
<script>
import TapHere from './TapHere.svelte';
let enableButton;
$: enableButtonRect = enableButton && enableButton.getBoundingClientRect();
let promise = new Promise((resolve) => {
setInterval(resolve, 3000);
});
</script>
{#await promise}
<p>
waiting...
</p>
{:then}
<div>
<button bind:this={enableButton}>Enable</button>
<button>Disable</button>
<TapHere rect={enableButtonRect}/>
</div>
{/await}
The enableButton (and enableButtonRect) should cause TapHere component to react when the promise is resolved. If the div is not enclosed by {#await} it certainly does happen; but {#await} seems to prevent the reaction.
Describe the bug
From Stackoverflow [https://stackoverflow.com/questions/58228948/how-do-i-trigger-a-reaction-when-bindthis-is-used-in-await-in-svelte]
The enableButton (and enableButtonRect) should cause TapHere component to react when the promise is resolved. If the div is not enclosed by {#await} it certainly does happen; but {#await} seems to prevent the reaction.
To Reproduce
https://svelte.dev/repl/4e0e477d6a394a83a2d79b3d1fa50525?version=3.12.1
A green "Tap Here!" message should be shown.
The text was updated successfully, but these errors were encountered: