David Taylor a7cd220704
PERF: Use insertText more efficiently in replaceText (#28880)
Followup to e25578d702791bac80b431acd450cc53b6c39a3c

Using execCommand to replace the entire contents of the textarea is very slow for larger posts (it seems the browser does a reflow after every 'virtual keypress'.

This commit updates the `replaceText` function to be more surgical with its `insertAt` calls. Now it only selects & replaces the characters which are actually being replaced.
2024-09-12 16:11:39 +01:00
..