MCPcopy Create free account
hub / github.com/UI5/webcomponents / _adjustForIOSKeyboard

Method _adjustForIOSKeyboard

packages/main/src/Popover.ts:551–559  ·  view source on GitHub ↗

* Adjust the desired top position to compensate for shift of the screen * caused by opened keyboard on iOS which affects all elements with position:fixed. * @private * @param top The target top in px. * @returns The adjusted top in px.

(top: number)

Source from the content-addressed store, hash-verified

549 * @returns The adjusted top in px.
550 */
551 _adjustForIOSKeyboard(top: number): number {
552 if (!isIOS()) {
553 return top;
554 }
555
556 const actualTop = Math.ceil(this.getBoundingClientRect().top);
557
558 return top + (Number.parseInt(this.style.top || "0") - actualTop);
559 }
560
561 /**
562 * Callback invoked when the opener element's intersection status changes.

Callers 1

_showMethod · 0.95

Calls 1

isIOSFunction · 0.85

Tested by

no test coverage detected