Update src/browser/input/CompositionHelper.ts

This commit is contained in:
Daniel Imms
2026-03-11 13:12:36 +09:00
committed by GitHub
parent beeebca1a4
commit 1c1aac0da8
+2
View File
@@ -72,6 +72,8 @@ export class CompositionHelper {
*/
public compositionstart(): void {
this._isComposing = true;
// It's important to use the selection here instead of textarea length to avoid conflicts with
// screen reader mode
const start = this._textarea.selectionStart ?? this._textarea.value.length;
const end = this._textarea.selectionEnd ?? start;
this._compositionPosition.start = Math.min(start, end);