Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions page/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ ____ commit pre|edit ____
}
else {
onTextChange(input.value)
// Relying on event handler could be too late for next key stroke in thai e2e test.
// In practice this is not needed.
sendSurroundingText()
}
}

Expand Down
4 changes: 4 additions & 0 deletions page/focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export function focus() {
sendSurroundingText()
input.addEventListener('input', sendSurroundingText)
input.addEventListener('selectionchange', sendSurroundingText)
// Relying on selectionchange could be too late for next key stroke in punctuation e2e test.
// In practice this is not needed.
input.addEventListener('click', sendSurroundingText)
}

export function blur() {
Expand All @@ -91,6 +94,7 @@ export function blur() {
}
input.removeEventListener('mousedown', resetInput)
input.removeEventListener('compositionstart', resetInput)
input.removeEventListener('click', sendSurroundingText)
input.removeEventListener('input', sendSurroundingText)
input.removeEventListener('selectionchange', sendSurroundingText)
if (hasTouch) {
Expand Down
Loading