Skip to content

Commit

Permalink
fix(ui5-input): prevent js error when element is removed from DOM (#2405
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fifoosid authored Oct 28, 2020
1 parent 11d3bbc commit 0e507eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/base/src/StaticAreaItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class StaticAreaItem {
this._updateFragment();
}
await RenderScheduler.whenDOMUpdated(); // Wait for the content of the ui5-static-area-item to be rendered
return this.staticAreaItemDomRef.shadowRoot;
return this.staticAreaItemDomRef && this.staticAreaItemDomRef.shadowRoot;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ class Input extends UI5Element {

async _getPopover() {
const staticAreaItem = await this.getStaticAreaItemDomRef();
return staticAreaItem.querySelector("[ui5-popover]");
return staticAreaItem && staticAreaItem.querySelector("[ui5-popover]");
}

enableSuggestions() {
Expand Down

0 comments on commit 0e507eb

Please sign in to comment.