fix(web/ui): Also guard on kbdDiv

This commit is contained in:
Darcy Wong 2020-12-09 13:31:12 +07:00
parent 6ceafea1cc
commit eeb5044040

View file

@ -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);