Skip to content

Commit

Permalink
Set selectionStart and selectionEnd correctly
Browse files Browse the repository at this point in the history
Instead of defaulting to 0, we should put the selection always at the
end of the comment, else drag and dropping anything would insert it at
the very beginning
  • Loading branch information
sebastinez committed Dec 12, 2024
1 parent 7d5dad5 commit 8e066f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/ExtendedTextarea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
const unlistenArray: UnlistenFn[] = [];
let preview: boolean = $state(false);
let selectionStart = $state(0);
let selectionEnd = $state(0);
let selectionStart = $state(body.length);
let selectionEnd = $state(body.length);
let draggingOver = $state(false);
let dragEnterUnlistenFn: UnlistenFn | void;
let dragLeaveUnlistenFn: UnlistenFn | void;
Expand Down

0 comments on commit 8e066f2

Please sign in to comment.