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 positioned off screen in Chrome/Chromium/Edge with parent element "position: relative" (bootstrap default), display:inline #1162

Open
tgoeg opened this issue Mar 20, 2024 · 0 comments

Comments

@tgoeg
Copy link

tgoeg commented Mar 20, 2024

Bug description

Seeing the exact same problem as #806 on a Drupal webform that provides a tooltip for a radio button using tippyjs, using a site template based on bootstrap.
Bootstrap defines

.radio, .checkbox {
    position: relative;
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
}

This position: relative (not on html here like in the referenced ticket) together with display: inline is enough to misposition the tooltip way off the screen (to the left, in my case). It seems like a pretty common use-case to inline radio labels.

Note that this only happens on Chrome/Chromium/Edge, Firefox happily displays it where it should. Might be a webkit bug as well?

I think I am going to try and see whether the position: relative attribute is necessary and will disable it, but I feel this might be a problem more people might hit, given the popularity of bootstrap and its default attributes?

Reproduction

https://codepen.io/tgoeg/pen/wvZJzrz
Again, note that this only happens in Chrome/Chromium/Edge (most likely all webkit browsers), Firefox works flawlessly.

Versions tested:
edge: Version 122.0.2365.92
chrome: Version 123.0.6312.59
chromium: Version 120.0.6099.71

Firefox: 124.0 (works)

Meta-Issue: Can you please add to the reproduction guideline that in Codepen, the minuscule "Use template" button at the bottom of the screen has to be used? I lost half an hour trying to figure out how to actually get a link to my crafted test case as I started to work in the link provided in the reproduction guideline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant