Skip to content

Commit

Permalink
Merge pull request #10039 from keymanapp/fix/web/app-context-deadkey-…
Browse files Browse the repository at this point in the history
…reset

fix(web): app/webview did not clear deadkeys on context-reset
  • Loading branch information
jahorton authored Nov 23, 2023
2 parents 2a9a9e7 + 0f32515 commit 4970664
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/web/keyboard-processor/src/text/keyboardProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ export default class KeyboardProcessor extends EventEmitter<EventMap> {

resetContext(target?: OutputTarget) {
this.layerId = 'default';

// Make sure all deadkeys for the context get cleared properly.
target?.resetContext();
this.keyboardInterface.resetContextCache();

// May be null if it's a keyboard swap.
Expand Down
2 changes: 2 additions & 0 deletions web/src/engine/main/src/keymanEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ export default class KeymanEngine<

this.contextManager.configure({
resetContext: (target) => {
// Could reset the target's deadkeys here, but it's really more of a 'core' task.
// So we delegate that to keyboard-processor.
this.core.resetContext(target);
},
predictionContext: new PredictionContext(this.core.languageProcessor, this.core.keyboardProcessor),
Expand Down

0 comments on commit 4970664

Please sign in to comment.