inject does not work in dialogs
vojvodics opened this issue · comments
Describe the bug
When accessing useFlag in dialogs (I am using quasar dialog), I get the following error:
This happens because the values are provided from the root component.
The solution would be - not to use root level component for providing values, but install as a vue plugin.
I can make a PR for the implementation if you want me to - just note that this would be a breaking change
Steps to reproduce the bug
No response
Expected behavior
No response
Logs, error output, etc.
No response
Screenshots
No response
Additional context
No response
Unleash version
No response
Subscription type
No response
Hosting type
No response
SDK information (language and version)
No response
@vojvodics We'll take a look over the related PR and give you some feedback. Thanks for the bug report and code!
Hi @vojvodics,
I tried reproducing the issue you described with no luck:
https://github.com/nunogois/quasar-issue-11
Live demo: https://quasar-issue-11-j6gantfsq-nunogois.vercel.app/#/
Could you please describe your use case to see how it differs? A demo like the one I linked or steps to reproduce the bug would be great!
Thanks 🙂
@nunogois @sighphyre Thanks for the quick feedback!
@nunogois Sorry, my description wasn't clear enough, this happens when you use a dialog plugin. I updated the reproduction example: nunogois/quasar-issue-11#1
Live demo: https://quasar-issue-11-git-fork-vojvodics-main-nunogois.vercel.app/#/
Thanks @vojvodics, this is great and definitely gives us a better understanding of the issue. I agree that a plugin could be a good solution to this issue in order to provide this capability app-wide, even outside components.