Skip to content

Commit

Permalink
fix: #395
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Sep 25, 2024
1 parent ad319bf commit 957a537
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/sentence/TokensReplaceDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export default defineComponent({
this.startIndex = (event.target as HTMLInputElement).selectionStart || 0;
this.endIndex = (event.target as HTMLInputElement).selectionEnd || 0;
this.sentence = (event.target as HTMLInputElement).value;
if ((this.sentence[this.startIndex - 1] == ' ' || this.startIndex == 0) && this.sentence[this.endIndex] == ' ') {
this.selection = (event.target as HTMLInputElement).value.substring(this.startIndex, this.endIndex);
if ((this.sentence[this.startIndex - 1] == ' ' || this.startIndex == 0) && (this.sentence[this.endIndex] == ' ' || this.endIndex === this.sentence.length)) {
this.selection = (event.target as HTMLInputElement).value.substring(this.startIndex, this.endIndex)
this.tokensReplaceDialogOpened = !this.selection.includes(' ')
}
}
Expand Down

0 comments on commit 957a537

Please sign in to comment.