Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-input): Fix JS error thrown in IE #2022

Merged
merged 3 commits into from
Jul 28, 2020
Merged

fix(ui5-input): Fix JS error thrown in IE #2022

merged 3 commits into from
Jul 28, 2020

Conversation

ilhan007
Copy link
Member

For some reason the statement "this.responsivePopover.querySelectorAll("ui5-list>*") always returns an empty array in IE,
later leading to a JS error, when element from that array had to be accessed, so I had to tweak it a little bit. In addition:

  • Clean Input.html from ES6 code
  • Everything, related to "suggestion-item-preview" event and the "Quick View Card" topic
    is in separate Input_quickview.html page.

FIXES: #2019

@ilhan007 ilhan007 requested a review from vladitasev July 28, 2020 11:03
@@ -318,7 +319,7 @@ class Suggestions {
}

_getItems() {
return [...this.responsivePopover.querySelectorAll("ui5-list>*")];
return [...this.responsivePopover.querySelectorAll("ui5-li-suggestion-item, ui5-li-groupheader")];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I put >* before was that with the new hooks, people could create their own implementation with f.e. ui5-li-custom. At least add it here, if it is not possible to reliably get the children.

But before that, please try with:

[...this.responsivePopover.querySelector("ui5-list").children]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I tried it and it works this way as well

@ilhan007 ilhan007 requested a review from vladitasev July 28, 2020 13:00
@ilhan007 ilhan007 dismissed vladitasev’s stale review July 28, 2020 13:00

comment fixed

@ilhan007 ilhan007 merged commit 1d2a276 into master Jul 28, 2020
@ilhan007 ilhan007 deleted the fix-js-error branch July 28, 2020 15:45
ilhan007 added a commit that referenced this pull request Jul 28, 2020
For some reason the statement "this.responsivePopover.querySelectorAll("ui5-list>*") always returns an empty array in IE, later leading to a JS error, when element from that array had to be accessed, so I had to tweak it a little bit.

FIXES: #2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IE11] Input with suggestions breaks
2 participants