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

Tooltips via Popper.js? #952

Open
edemaine opened this issue Jan 21, 2021 · 1 comment · May be fixed by #953
Open

Tooltips via Popper.js? #952

edemaine opened this issue Jan 21, 2021 · 1 comment · May be fixed by #953

Comments

@edemaine
Copy link
Contributor

edemaine commented Jan 21, 2021

Bootstrap.js (since v4) uses Popper.js to display tooltips. One of the nice things about Popper.js is that has flags to automatically prevent tooltips from leaving the screen and to flip orientation of tooltips to do the same. I've grown to really like these, and now my bootstrap-slider tooltips stick out (literally) for not having this feature -- especially my left and right extreme tooltips tend to extend beyond the screen width (previously reported in #649).

It would be nice to be able to use Popper.js for slider tooltips. I see a few possibilities:

  1. Add Popper.js as a dependency; hopefully not an issue for people using Bootstrap, though there are Popper v1 vs. v2 issues. (I believe Bootstrap v4 uses Popper v1 while Bootstrap v5 uses Popper v2, and there are some compatibility issues.)
  2. Detect Popper.js and use it if so (similar to current jQuery dependency).
  3. Add callback/option(s) for custom tooltips that would allow someone to switch to Popper.js (or another system) themselves.

Do you have a sense of which of these options (if any) would be most preferable from your perspective?

@seiyria
Copy link
Owner

seiyria commented Jan 21, 2021

Personally, if I were to review/accept a PR for this, it would have to be option 2, or 3, or both (ideally, both, with the third overriding the second). We do not have any dependencies and I would like to keep it that way, although we do have popper as a devDep (not sure why; I would have to review to see).

We would happily accept a PR for this!

@edemaine edemaine linked a pull request Jan 22, 2021 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants