Skip to content

Commit

Permalink
fix(ios): hard context resets
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Horton authored and Joshua Horton committed Mar 12, 2024
1 parent 4b11a5d commit 3240ee7
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,16 @@ function setKeymanContext(text, doSync, selStart, selLength) {
let selEnd = selStart + selLength;
selEnd = isNaN(selEnd) ? undefined : selEnd;

const shouldReset = keyman.context.updateContext(text, selStart, selEnd);
if(!doSync || shouldReset) {
if(doSync) {
const shouldReset = keyman.context.updateContext(text, selStart, selEnd);
if(shouldReset) {
keyman.resetContext();
}
} else {
// if not in "sync" mode, we have a hard context reset; just full-reset it.
keyman.context.setText(text);
keyman.context.setSelection(selStart, selStart+selLength);
keyman.resetContext();
}
}

Expand Down

0 comments on commit 3240ee7

Please sign in to comment.