-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Feature: Pass plugin values to Tippy props #152
Comments
You're welcome to create a PR. We can use inputs or DI to pass it. |
I'm clear on how to use inputs to pass it in. Not sure how DI would work, could you explain a bit more before I get started? Something like this? |
The real question is whether you expect the plugin to apply globally to all instances or just a specific one? |
Well, you can provide a default value for the plugin which would then apply globally. What I'm trying to do is create a plugin that exists for all instances, but only takes effect for instances that have a specific prop value. Sort of like this code from the Tippy docs:
In this scenario, you can provide the |
So we could add the plugins at the config label and expose additional input that will apply it as in your example. |
Correct, that would be my aim. The plugin values exist at the top level of the
That means that the functionality in the Here's what the usage could look like: <app-my-thing [tp]="tippyTemplate" [tpPluginValues]="{ followCursor: true }"> or <app-my-thing [tp]="tippyTemplate" [tpTippyProps]="{ followCursor: true }"> |
tpTippyProps If it goes to tippy props |
I'm submitting a...
Current behavior
In Tippy, if you add a plugin, that plugin now accepts a value on the TippyProps matching that plugin name. Helipopper does allow adding plugins, but there doesn't appear to be a way to pass those plugin values into the TippyProps from the TippyDirective.
This means that the plugin strategy for Tippy is handicapped in a way that is preventing me from solving a problem.
Expected behavior
Ideally, there would be an input like
[tpPluginValues]="{ myPlugin: 123 }"
that would pass these values into the TippyProps. I do understand that there could be some annoyances if somebody names their plugin the same thing as a "core" tippy prop, but this is how the Tippy plugins work.What is the motivation / use case for changing the behavior?
I'm trying to write a plugin for a "singletonGroup" which allows only one Tippy to be open per group key. I can't pass the group key into the plugin though. Plugins are useful for the maintainer of helipopper because people can extend the library with bespoke functionality.
Environment
The text was updated successfully, but these errors were encountered: