mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-19 20:37:47 +00:00
Merge pull request #6861 from keymanapp/fix/web/stable/6853-refresh-layout-undef-guard
fix(web): better stability during transient OSK load state 🍒
This commit is contained in:
commit
133d6ca5a3
1 changed files with 3 additions and 2 deletions
|
|
@ -450,7 +450,8 @@ namespace com.keyman.osk {
|
|||
}
|
||||
|
||||
// Step 1: have the necessary conditions been met?
|
||||
const fixedSize = this.width && this.height && this.width.absolute && this.height.absolute;
|
||||
const hasDimensions = this.width && this.height;
|
||||
const fixedSize = hasDimensions && this.width.absolute && this.height.absolute;
|
||||
const computedStyle = getComputedStyle(this._Box);
|
||||
const isInDOM = computedStyle.height != '' && computedStyle.height != 'auto';
|
||||
|
||||
|
|
@ -458,7 +459,7 @@ namespace com.keyman.osk {
|
|||
if(fixedSize) {
|
||||
this._computedWidth = this.width.val;
|
||||
this._computedHeight = this.height.val;
|
||||
} else if(isInDOM) {
|
||||
} else if(isInDOM && hasDimensions) {
|
||||
const parent = this._Box.offsetParent as HTMLElement;
|
||||
this._computedWidth = this.width.val * (this.width.absolute ? 1 : parent.offsetWidth);
|
||||
this._computedHeight = this.height.val * (this.height.absolute ? 1 : parent.offsetHeight);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue