Skip to content

Commit

Permalink
fix: repl example '<svelte:document>' (sveltejs#871)
Browse files Browse the repository at this point in the history
Fixing the repl example '<svelte:document>'

Svelte Repl isn't working without `.toString()` on the selection.
  • Loading branch information
delight authored Nov 25, 2024
1 parent e88231b commit 799fd0f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
let selection = $state('');
const handleSelectionChange = (e) => (selection = document.getSelection());
const handleSelectionChange = (e) => (selection = document.getSelection().toString());
</script>

<svelte:document onselectionchange={handleSelectionChange} />
Expand Down

0 comments on commit 799fd0f

Please sign in to comment.