THEOplayer / web-ui

UI component library for the THEOplayer Web SDK
https://www.theoplayer.com/docs/open-video-ui/web/
MIT License
10 stars 0 forks source link

Fix `closeMenu()` when not yet fully upgraded #49

Closed MattiasBuelens closed 7 months ago

MattiasBuelens commented 7 months ago

When rapidly creating and destroying the UI (such as when using Webpack's Hot Module Replacement), I ran into an edge case where UIContainer._onSourceChange was called before the <theoplayer-menu-group> was properly registered. This led to a TypeError when trying to call closeMenu() on a non-upgraded element.

This should hopefully fix that.