Browse Source

Simpler comparison

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>
catboxanon 1 year ago
parent
commit
5ab5405b6f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      javascript/edit-attention.js

+ 2 - 2
javascript/edit-attention.js

@@ -65,10 +65,10 @@ function keyupEditAttention(event) {
         }
 
         // deselect surrounding whitespace
-        while (target.value.slice(selectionStart, selectionStart + 1) == " " && selectionStart < selectionEnd) {
+        while (text[selectionStart] == " " && selectionStart < selectionEnd) {
             selectionStart++;
         }
-        while (target.value.slice(selectionEnd - 1, selectionEnd) == " " && selectionEnd > selectionStart) {
+        while (text[selectionEnd - 1] == " " && selectionEnd > selectionStart) {
             selectionEnd--;
         }