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

Create a tooltip without UI triggers #3451

Closed
stigok opened this issue Jun 5, 2019 · 5 comments · Fixed by #3908 · May be fixed by thislooksfun/earthdawn#37

Comments

@stigok
Copy link

commented Jun 5, 2019

Is your feature request related to a problem? Please describe...

I am unable to have a button with v-b-tooltip directive that is exclusively triggered programmatically.

Describe the solution you'd like

A simple way to disable all UI triggers or empty the trigger list after its initialisation.

Describe alternatives you've considered

  • Disabling the tooltip by default using v-b-directive.disabled, or v-b-tooltip="objRef" with a property containing disabled, could potentially silence all events, but still make me able to hide or show the tooltip with the show property.
  • Passing an empty string currently falls back to the defaults (click blur), so passing an empty array through options could signify the explicit wish to keep triggers empty.
  • A trigger called none which prevents falling back to defaults.

Additional context

My use-case is an "Add item to cart"-button that should show "Item added to cart"-tooltip when the click event has propagated to the backend server, then, afterwards, hidden again automatically using delay.hide.

@Hiws

This comment has been minimized.

Copy link

commented Jun 5, 2019

I think the suggestion of having a trigger "none" is a good idea.
However, have you considered using the b-tooltip component instead of the directive?

Tried creating your usecase in a codepen here: https://codepen.io/Hiws/pen/dELaNN

@stigok

This comment has been minimized.

Copy link
Author

commented Jun 5, 2019

I'd be happy to submit a PR with code implementing none if the maintainers support that idea.

@Hiws: Your proposed solution to my use-case using b-tooltip works excellently -- thanks!

@tmorehouse

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

The directive versions of tooltip/popover are meant to be quick and simple implementation alternatives to the more configurable component versions (which provide more flexibility).

Tooltips and Popovers are currently going through a re-write (to use our new internal portalling technique) and to make the directive versions more reactive to changes in modifiers and titles/content).

Perhaps once we get the conversion complete, you could add in a PR for the none trigger (or perhaps call it manual, as that is what the programmatic triggering is called in the Bootstrap v4.3 docs)

@tmorehouse

This comment has been minimized.

Copy link
Member

commented Aug 28, 2019

@stigok @Hiws v2.0.0 stable will support 'manual' trigger, where no event listeners (hover, focus, or click) are added to the trigger (target) element, and the tooltip/popover can only be opened programmatically (i.e. via the show prop or instance/$root events). This is available for both component and directive versions (show prop only on component version though).

See PR #3908 and deploy preview https://deploy-preview-3908--bootstrap-vue.netlify.com/docs/components/tooltip

We should have 2.0.0 stable released this week.

2.0.0 Stable automation moved this from In Progress to Completed Aug 28, 2019

tmorehouse added a commit that referenced this issue Aug 28, 2019
@tmorehouse

This comment has been minimized.

Copy link
Member

commented Sep 7, 2019

BootstrapVue v2.0.0 stable has been released. See https://bootstrap-vue.js.org/docs/misc/changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4 participants
You can’t perform that action at this time.