CC-959: Hide instead of destroy Tippy instance on disconnect #2546
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira
Summary
Fixes a rare bug where a Popover/Tooltip inside of a Bolt List (or any other web component) fails to open.
Details
When a Popover/Tooltip is inside another Bolt web component, and that other web component renders after the Popover/Tooltip has rendered, it will trigger the Popover/Tooltip to disconnect. We are currently destroying the Tippy instance on disconnect. When the Popover/Tooltip reconnects, I expected it would reinitialize the Tippy instance, but it does not because the component's
firstUpdated()
lifecycle event only fires on the initial creation.Instead of destroying the Tippy instance I am now just hiding it, which solves the original problem we sought to fix in #2513, without creating this other bug.
How to test
/pattern-lab/?p=tests-popover-disconnected-callback
packages/components/bolt-list/index.js
) with this: