fix(overlays): don't call _setupOverlayCtrl() in OverlayMixin if the component is not connected
In our application, there is a very complicated logic that creates a bunch of form fields based on some data. It's very complicated, we hate that logic; but it exists, it works, and it is being used in production.
Somewhere in that logic, under a very specific case, a datepicker form field is created, connected, and then immediately disconnected. Don't ask me why, I said it is complicated.
This commit fixes a bug in OverlayMixin. The connectedCallback calls _setupOverlayCtrl() asynchronously, after a Promise.then(). Thus, by the time this setup function is called, the component has already been disconnected (and disconnectedCallback() has already been called).
The fix is simple: don't try to setup the overlay if the component is no longer connected.
⚠️ No Changeset found
Latest commit: 80f6b1c9b3c6cbfbc544677e5bb98021794eaf41
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Added a second one-line commit that fixes a similar issue in FocusMixin.