mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-27 10:47:41 +00:00
fix(web): touch-based unit test issues
This commit is contained in:
parent
48fe02023c
commit
da8e83090a
2 changed files with 5 additions and 3 deletions
|
|
@ -31,7 +31,9 @@ namespace com.keyman.osk.browser {
|
|||
let util = keyman.util;
|
||||
|
||||
// Create and display the preview
|
||||
if(on) {
|
||||
// If !key.offsetParent, the OSK is probably hidden. Either way, it's a half-
|
||||
// decent null-guard check.
|
||||
if(on && key.offsetParent) {
|
||||
// The key element is positioned relative to its key-square, which is,
|
||||
// in turn, relative to its row. Rows take 100% width, so this is sufficient.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ namespace com.keyman.osk {
|
|||
}
|
||||
|
||||
public get activeInputCount(): number {
|
||||
if(window['TouchEvent'] && this.source instanceof TouchEvent) {
|
||||
return this.source.touches.length;
|
||||
if(window['TouchEvent'] && this.source['touches'] !== undefined && this.source['touches'] !== null) {
|
||||
return this.source['touches'].length;
|
||||
} else {
|
||||
const event = this.source as MouseEvent;
|
||||
return event.buttons > 0 ? 1 : 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue