diff --git a/web/src/engine/osk/src/views/floatingOskView.ts b/web/src/engine/osk/src/views/floatingOskView.ts index 11b26073c4..ec1bc0877a 100644 --- a/web/src/engine/osk/src/views/floatingOskView.ts +++ b/web/src/engine/osk/src/views/floatingOskView.ts @@ -51,6 +51,7 @@ export default class FloatingOSKView extends OSKView { // Add header element to OSK only for desktop browsers this.titleBar = new TitleBar(this.titleDragHandler); + // this.titleBar.on('help', () => { this.legacyEvents.callEvent('helpclick', {}); }); @@ -91,6 +92,12 @@ export default class FloatingOSKView extends OSKView { listenerSpy.on('listenerremoved', onListenedEvent); } + if(this.activeKeyboard) { + // If the keyboard was loaded during OSK init, we may need to set the + // title in place now, as it wasn't possible at the standard time. + this.postKeyboardAdjustments(); + } + this.loadPersistedLayout(); } @@ -119,6 +126,12 @@ export default class FloatingOSKView extends OSKView { } protected postKeyboardAdjustments() { + // It is possible for this to be called during OSK initialization, + // when `this.titleBar` has not yet been initialized. + if(!this.titleBar) { + return; + } + // Add header element to OSK only for desktop browsers this.enableMoveResizeHandlers(); if(this.activeKeyboard) { diff --git a/web/src/test/manual/web/index.html b/web/src/test/manual/web/index.html index 218eaa3a45..8ee99a5ac3 100644 --- a/web/src/test/manual/web/index.html +++ b/web/src/test/manual/web/index.html @@ -75,6 +75,7 @@
--End of Document--
+ + + + +