Skip to content

A platform for community discussion. Free, open, simple.

PERF: Update `maybeContinueList` to avoid replacing the entire post (#29416)

David Taylor3076b6e8d2af
diff --git a/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js b/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js
index 3ed5585f97d..8c8b6597e84 100644
--- a/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js
+++ b/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js
@@ -619,11 +619,7 @@ export default class TextareaTextManipulation {
} else {
// Clear the new autocompleted list item if there is no other text.
const offsetWithoutPrefix = offset - `\n${listPrefix}`.length;
- this.replaceText(
- text,
- text.substring(0, offsetWithoutPrefix) + text.substring(offset),
- { skipNewSelection: true }
- );
+ this._insertAt(offsetWithoutPrefix, offset, "");
this.selectText(offsetWithoutPrefix, 0);
}
}