Closed MarcusNotheis closed 2 years ago
Also looks like the icon import for background
is missing:
https://github.com/SAP/ui5-webcomponents/blob/11e686ffd64fbabc1ed80cff3238a9ebd2d4c234/packages/fiori/src/MediaGalleryItem.hbs#L11-L13
Hello @SAP/ui5-webcomponents-topic-p could you take a look of this issue with priority. I will also ask @vladitasev if he remembers the case that Marcus described.
@MarcusNotheis is right, I found the related previous PR https://github.com/SAP/ui5-webcomponents/issues/3073
Basically the properties should be set in connectedCallback
instead of in the constructor.
Here is more information from the spec https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-conformance
relevant parts:
Bug Description
When the Web Components core is booted and a
ui5-media-gallery-item
is added to the DOM, an error is thrown:Expected Behavior
There should be no error thrown
Steps to Reproduce
Show Media Gallery Item
It looks like this is only happening when the UI5 Web Components core is already booted - if you change the
useState
initial value to true the error isn't thrownIsolated Example
https://codesandbox.io/s/angry-spence-gv19h?file=/src/App.js
Context
ui5-media-gallery-item
Log Output / Stack Trace / Screenshots
Priority
Additional Information
I think this error is related to these lines: https://github.com/SAP/ui5-webcomponents/blob/417bd6aad5829de578cc91487fa080af4699e450/packages/fiori/src/MediaGalleryItem.js#L182-L186 As far as I remember, it is not allowed to set attributes of a custom element in the constructor. I think we had a similar issue with the
ui5-button
long time ago (something with setting _isTouch or sth) - maybe @vladitasev remembers 🙂