Skip to content

Commit ee05d5d

Browse files
committed
fix: avoid issues with virtual keyboard on ios devices
1 parent 2f06f2d commit ee05d5d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

packages/main/src/Dialog.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import DialogTemplate from "./DialogTemplate.js";
2929
import PopupsCommonCss from "./generated/themes/PopupsCommon.css.js";
3030
import dialogCSS from "./generated/themes/Dialog.css.js";
3131
import PopupAccessibleRole from "./types/PopupAccessibleRole.js";
32+
import { isIOS } from "@ui5/webcomponents-base";
3233

3334
/**
3435
* Defines the step size at which this component would change by when being dragged or resized with the keyboard.
@@ -329,7 +330,16 @@ class Dialog extends Popup {
329330

330331
_show() {
331332
super._show();
332-
requestAnimationFrame(this._center.bind(this));
333+
334+
if (isIOS()) {
335+
this._updateMediaRange();
336+
this._center();
337+
} else {
338+
requestAnimationFrame(() => {
339+
this._updateMediaRange();
340+
this._center();
341+
});
342+
}
333343
}
334344

335345
onBeforeRendering() {

packages/main/src/Popup.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,6 @@ abstract class Popup extends UI5Element {
604604
if (this.isConnected) {
605605
this.setAttribute("popover", "manual");
606606
this.showPopover();
607-
608-
requestAnimationFrame(this._updateMediaRange.bind(this));
609607
}
610608
}
611609

0 commit comments

Comments
 (0)