From eeb5044040dea48418465e1c8a88d7e1e63af255 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 9 Dec 2020 13:31:12 +0700 Subject: [PATCH] fix(web/ui): Also guard on kbdDiv --- web/source/osk/visualKeyboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/source/osk/visualKeyboard.ts b/web/source/osk/visualKeyboard.ts index 24c6937b7c..96879d3010 100644 --- a/web/source/osk/visualKeyboard.ts +++ b/web/source/osk/visualKeyboard.ts @@ -1212,7 +1212,7 @@ namespace com.keyman.osk { let height = (this.kbdDiv.firstChild as HTMLElement).offsetHeight; // firstChild == layer-group, has height info. // We need to adjust the offset properties by any offsets related to the active banner. - var yMin = (_Box) ? Math.max(5, this.kbdDiv.offsetTop + _Box.offsetTop - 0.25*height) : 5; + var yMin = (this.kbdDiv && _Box) ? Math.max(5, this.kbdDiv.offsetTop + _Box.offsetTop - 0.25*height) : 5; if(key0 && e.touches[0].pageY < yMin) { this.highlightKey(key0,false); this.showKeyTip(null,false);