Skip to content

Commit

Permalink
Merge pull request #10346 from keymanapp/fix/web/offset-switch-keyboard
Browse files Browse the repository at this point in the history
fix(web): Add null check for changing the keyboard during typing
  • Loading branch information
darcywong00 authored Jan 17, 2024
2 parents f9065a0 + 5e099a6 commit 36f14db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/engine/osk/src/input/gestures/browser/subkeyPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ export default class SubkeyPopup implements GestureHandler {
const _Box = vkbd.topContainer;
let rowElement = (e.key as OSKBaseKey).row.element;
let ss=subKeys.style;
var x = e.offsetLeft + (<HTMLElement>e.offsetParent).offsetLeft + 0.5*(e.offsetWidth-subKeys.offsetWidth);
let parentOffsetLeft = e.offsetParent ? (<HTMLElement>e.offsetParent).offsetLeft : 0;
var x = e.offsetLeft + parentOffsetLeft + 0.5*(e.offsetWidth-subKeys.offsetWidth);
var xMax = vkbd.width - subKeys.offsetWidth;

if(x > xMax) {
Expand Down

0 comments on commit 36f14db

Please sign in to comment.