Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose global recomputeAllPoppers helper #1010

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Conversation

antfu
Copy link
Collaborator

@antfu antfu commented Jan 15, 2024

Currently, Floating Vue is already calling this function on the window resize event. While in some cases, user might want to trigger this manually in cases like tab switch or the others.

For example https://twoslash.netlify.app/refs/notations, when you click the Input Code on the first tab group, you will see the popup still persist.

Copy link

netlify bot commented Jan 15, 2024

Deploy Preview for v-tooltip ready!

Name Link
🔨 Latest commit 72c0e09
🔍 Latest deploy log https://app.netlify.com/sites/v-tooltip/deploys/65a565c829e63400080e3e2d
😎 Deploy Preview https://deploy-preview-1010--v-tooltip.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Akryum
Copy link
Owner

Akryum commented Jan 15, 2024

I'm not sure I understand the link between the issue and recomputeAllPoppers. Would the correct behavior be to hide the popper?

@antfu
Copy link
Collaborator Author

antfu commented Jan 16, 2024

Current behavior:

Screen.Recording.2024-01-16.at.10.11.57.mov

Expected behavior:

Screen.Recording.2024-01-16.at.10.12.57.mov

This PR itself does not fix the issue but adds the capability of it. Users could add the call to recomputeAllPoppers on tab switch.

@antfu
Copy link
Collaborator Author

antfu commented Jan 16, 2024

A temporary workaround we have: twoslashes/twoslash@0e8ceca

@Akryum
Copy link
Owner

Akryum commented Jan 17, 2024

Wouldn't it be better to observe visibility on target?

@Akryum Akryum merged commit 1d9953d into main Jan 17, 2024
4 checks passed
@Akryum Akryum deleted the feat/recomputeAllPoppers branch January 17, 2024 13:14
@antfu
Copy link
Collaborator Author

antfu commented Jan 17, 2024

Wouldn't it be better to observe visibility on target?

That would do, are you ok with enabling it by default for listening to every element?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants