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

Expounding on "opt-in for performance reasons" #29378

Open
jonathanhefner opened this issue Sep 6, 2019 · 5 comments
Open

Expounding on "opt-in for performance reasons" #29378

jonathanhefner opened this issue Sep 6, 2019 · 5 comments

Comments

@jonathanhefner
Copy link
Contributor

In the documentation for both Tooltips and Popovers is the caveat: "opt-in for performance reasons, so you must initialize them yourself." But I'm having trouble finding a detailed explanation of "performance reasons." The caveat is at least 6 years old, which makes me wonder if it's still true.

Also, many people miss this caveat when reading the documentation, for example #24985 and #15458. So it would be great if Tooltips and Popovers could actually be automatically initialized in a performant way. That might also pair nicely with using MutationObserver to automatically remove Tooltips in v5.

@Johann-S
Copy link
Member

Johann-S commented Sep 6, 2019

Hi @jonathanhefner, there is a way to do that, you can use our selector option and it'll initialize Popovers and Tooltip automatically.
Maybe after the switch to our v5 (without jQuery) we can remove that 🤔

@mdo
Copy link
Member

mdo commented Jan 12, 2021

Bumping @twbs/js-review on this—would we want to make this the default in v5? Is that a breaking change that we'd need to punt to v6?

@XhmikosR
Copy link
Member

TBH we need some kind of benchmark before everything else. The reasons behind this choice may no longer apply to v5, but it can indeed be a breaking change.

@lacutah
Copy link
Contributor

lacutah commented Mar 25, 2021

Follow up / tangential to this as a user of bootstrap:

  1. The "opt-in" requirement and guidance already seemed weird because adding the `data-[bs-]toggle='tooltip`` attribute to an element already is EXPLICIT that you want tool-tip popup behavior.
  2. Inconsistency with other controls - why the additional extra step of manual JavaScript initialization when default behavior it to self-initialize from data attributes.

@mdo
Copy link
Member

mdo commented Jun 14, 2021

I agree with @XhmikosR on needing to re-evaluate this. @twbs/js-review Can any of you review and make a suggestion for how to better handle tooltips and popovers here without requiring extra work?

@mdo mdo added the v6 label Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Inbox
Development

No branches or pull requests

7 participants
@mdo @XhmikosR @jonathanhefner @Johann-S @MartijnCuppens @lacutah and others