mirror of
https://github.com/keymanapp/keyman.git
synced 2026-11-03 09:37:47 +00:00
fix(web): pre-init keyboard activation awaits init before proceeding
Fixes: #11504 Cherry-pick-of: #11505
This commit is contained in:
parent
d3f41a518a
commit
5249b67f33
1 changed files with 12 additions and 0 deletions
|
|
@ -155,6 +155,18 @@ export default class ContextManager extends ContextManagerBase<WebviewConfigurat
|
|||
}
|
||||
|
||||
public async activateKeyboard(keyboardId: string, languageCode?: string, saveCookie?: boolean): Promise<boolean> {
|
||||
/*
|
||||
this.keyboardCache isn't set until partway through KMW initialization.
|
||||
Also, keyboard stubs aren't processed until initialization is complete,
|
||||
so it's best to wait for initialization anyway.
|
||||
*/
|
||||
if(!this.engineConfig.deferForInitialization.isFulfilled) {
|
||||
await this.engineConfig.deferForInitialization.corePromise;
|
||||
|
||||
// Our mobile app-engines all register the stub before attempting to set the keyboard,
|
||||
// so the Promise ordering here should work in our favor.
|
||||
}
|
||||
|
||||
// If the default keyboard is requested, load that. May vary based on form-factor, which is
|
||||
// part of what .getFallbackStubKey() handles.
|
||||
if(!keyboardId) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue