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

Move to Alpine.js Anchor plugin #13333

Closed
zepfietje opened this issue Jun 20, 2024 · 6 comments
Closed

Move to Alpine.js Anchor plugin #13333

zepfietje opened this issue Jun 20, 2024 · 6 comments
Labels
enhancement New feature or request help wanted ui
Milestone

Comments

@zepfietje
Copy link
Member

zepfietje commented Jun 20, 2024

Replaces the following direct dependencies: tippy.js, alpine-floating-ui, and alpine-tooltip.

Replaces #8701.

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@zepfietje
Copy link
Member Author

zepfietje commented Jun 20, 2024

@awcodes are there any differences between your plugin and the Alpine.js one?

Asking since Livewire ships with the Alpine.js plugin and we're also going to move to the Alpine.js Sort plugin.

@zepfietje zepfietje changed the title Replace Tippy.js/Popper with Floating UI Move to Alpine.js Anchor plugin Jun 20, 2024
@awcodes
Copy link
Contributor

awcodes commented Jun 20, 2024

Anchor is a lot less flexible. It only offers placement and offset settings and it requires more manual set up. Also, to my knowledge it isn't a11y compatible out of the box.

@zepfietje
Copy link
Member Author

Alright, thanks for clarifying, @awcodes!

@awcodes
Copy link
Contributor

awcodes commented Jun 22, 2024

Something else to keep in mind with this is that anchor fundamentally operates in a different way than we are using the floating ui plugin. Anchor just says attach this element to this other element vs this element has a drop down component. If that makes sense. So, switching to anchor will lose the context and ability to use the open/close/toggle methods which are embedded with the floating ui alpine plugin. More importantly the biggest issue i see is that anchor doesn't support teleport which it looks like every instance of the floating ui implementation is using by default so we could run into a lot of z index issues.

@zepfietje
Copy link
Member Author

Thanks for the clear summary, @awcodes!

I agree the missing teleport feature is a deal-breaker.
However, maybe we could use HTML's popover API?

@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Jun 24, 2024
@danharrin danharrin closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
@danharrin danharrin removed this from Roadmap Jun 26, 2024
@binaryfire
Copy link
Contributor

Thanks for the clear summary, @awcodes!

I agree the missing teleport feature is a deal-breaker. However, maybe we could use HTML's popover API?

Hey @zepfietje. A bit off topic, but I just stumbled across this and thought I'd mention that browser support for the popover API isn't great. They used it for Flux UI's dropdowns and they're completely broken on my iPhone X. It's definitely worth checking Can I Use before implementing any new APIs. Anything above ~94% is ok. Anything less and there will usually be problems on
still fairly modern (eg. 2 year old) browsers.

This page also shows it only has partial support: https://developer.mozilla.org/en-US/docs/Web/API/Popover_API

And there are ongoing iOS issues: https://bugs.webkit.org/show_bug.cgi?id=267688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted ui
Projects
None yet
Development

No branches or pull requests

4 participants