-
-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
enhancementNew feature or requestNew feature or requestperformancequestionFurther information is requestedFurther information is requestedstandards
Milestone
Description
Question
It's not a bug, so I've chosen the "question" template. I looked at the source code, and I've found some worrying parts:
| document.querySelector("instagram-widget").shadowRoot.querySelector(".instagram-widget-photos").innerHTML = html; |
Your code won't work if there will be more elements on the same page. It will always update the first one. You can just reference your element by this - so instead querying document to access shadowRoot, you can use this.shadowRoot (after initializing it).
| window.onresize = () => { |
This is unsafe and can break other code. You assume that the user won't use window.onresize syntax, but he can, and then your callback is gone. You should use window.addEventListener().
| if (self.options["force-square"] === "yes") { |
Because of that, the onresize will only refer to the last instance of your component, so the above setting will apply from the last instance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestperformancequestionFurther information is requestedFurther information is requestedstandards