From e44aa46d10afac98e7721025b138c07131b0dd23 Mon Sep 17 00:00:00 2001 From: Filip Siderov Date: Tue, 24 Mar 2020 11:22:35 +0200 Subject: [PATCH] fix(ui5-input): fix javascript error on mobile --- packages/main/src/Input.js | 3 +-- packages/main/src/features/InputSuggestions.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/main/src/Input.js b/packages/main/src/Input.js index 43062c669202..ec9d81bbf14d 100644 --- a/packages/main/src/Input.js +++ b/packages/main/src/Input.js @@ -596,7 +596,6 @@ class Input extends UI5Element { } } - getInputValue() { const inputDOM = this.getDomRef(); if (inputDOM) { @@ -609,7 +608,7 @@ class Input extends UI5Element { let inputDomRef; if (isPhone()) { - inputDomRef = this.getStaticAreaItemDomRef().querySelector(".ui5-input-inner-phone"); + inputDomRef = this.Suggestions.responsivePopover.querySelector(".ui5-input-inner-phone"); } if (!inputDomRef) { diff --git a/packages/main/src/features/InputSuggestions.js b/packages/main/src/features/InputSuggestions.js index c217b2af663f..c23e22e1dee1 100644 --- a/packages/main/src/features/InputSuggestions.js +++ b/packages/main/src/features/InputSuggestions.js @@ -277,6 +277,10 @@ class Suggestions { } async _respPopover() { + if (this.responsivePopover) { + return this.responsivePopover; + } + const staticAreaItem = await this._getComponent().getStaticAreaItemDomRef(); this.responsivePopover = staticAreaItem.querySelector("ui5-responsive-popover"); return this.responsivePopover;