renatodeleao / a11y-vue-dialog

An accessibility-first renderless (headless) dialog component made for Vue https://renatodeleao.github.io/a11y-vue-dialog/
MIT License
12 stars 1 forks source link

Add note about limitation with provide/inject while using portal #16

Closed renatodeleao closed 2 years ago

renatodeleao commented 4 years ago

A know limitation of portal-vue so while this depends on it we should warn users.

Gladely vue 3 new <Teleport /> won't have these issues

Related

LinusBorg commented 4 years ago

This limitation of my portal-vue lib was one of the reasons that I later created https://github.com/LinusBorg/vue-simple-portal

It's aimed precisely at the use case of components that only need to be moved ot the bottom of the <body> element's children and doesn't have the limitation concerning inject and $parent.

So maybe give it a try. As a bonus, it's much lighter than portal-vue. And closer to how the native teleport in Vue 3 works.

renatodeleao commented 4 years ago

@LinusBorg thanks for stopping by, it's not everyday that you have core vue members around!

I must admit that I was not aware of that "lite" version, i'll make sure to give it a spin, and include a reference in the docs as a suggestion for people who might be using provide/inject with this component.

Not sure if you seen it, but I was actually thinking about making this component portal-agnostic https://github.com/renatodeleao/a11y-vue-dialog/issues/11: although I strongly suggest and recommend using a portal implementation for dialogs (particularly yours), i'm thinking about not including portal-vue as an explicit dependency since this should allegedly work with all portal-vue versions (including that simple one) and any other portal implementations (not that i'm aware of any other actual alternative to portal-vue to be honest, but devs like to have their own things), so your comment gives an extra push to that idea.

Lastly many thanks for portal-vue been using it almost since my day one in vueland. Cheers!

LinusBorg commented 4 years ago

Sound like a good plan.

And thanks for the kind words :)