Skip to content

Commit f63972a

Browse files
committed
fix: ellipsis not working correctly
closes #7156 closes #7149
1 parent 0faccf7 commit f63972a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/src/ts/input/handlers/insert-text.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ type OnInsertTextParams = {
6262

6363
export async function onInsertText(options: OnInsertTextParams): Promise<void> {
6464
const { now, lastInMultiIndex, isCompositionEnding } = options;
65+
const { inputValue } = getInputElementValue();
6566

6667
if (options.data.length > 1) {
6768
// remove the entire data from the input value
6869
// make sure to not call TestInput.input.syncWithInputElement in here
6970
// it will be updated later in the body of onInsertText
70-
const { inputValue } = getInputElementValue();
7171
setInputElementValue(inputValue.slice(0, -options.data.length));
7272
for (let i = 0; i < options.data.length; i++) {
7373
const char = options.data[i] as string;
@@ -88,6 +88,10 @@ export async function onInsertText(options: OnInsertTextParams): Promise<void> {
8888
TestWords.words.getCurrent()[TestInput.input.current.length] !==
8989
options.data
9090
) {
91+
// replace the data with the override
92+
setInputElementValue(
93+
inputValue.slice(0, -options.data.length) + charOverride
94+
);
9195
await onInsertText({
9296
...options,
9397
data: charOverride,

0 commit comments

Comments
 (0)