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

Using "tooltip tooltip-bottom" will render under relatively-positioned text below #1401

Closed
dennisjlee opened this issue Nov 30, 2022 · 2 comments

Comments

@dennisjlee
Copy link

In my app, I was trying to put multiple items in a list with a Daisy tooltip on each item. If I use the classes "tooltip tooltip-bottom", then the tooltip on one item will overlap the item below. But instead of rendering above the item, the tooltip appears underneath the item below (see screenshot).

Example markup:

        <div
          class="tooltip tooltip-bottom tooltip-accent block"
          data-tip="HELLO WORLD"
        >
          hello world
        </div>
        <div
          class="tooltip tooltip-top tooltip-accent block"
          data-tip="GOOD NIGHT MOON"
        >
          good night good night good night
        </div>

Expected behavior:

image

Actual behavior:

image

I have a sandbox showing the bug here, with an attempt at a fix using z-index:

https://codesandbox.io/s/daisy-ui-tooltips-overlapping-hw825v?file=/index.html

@adam-seedata-io
Copy link

Give this a try
Added these classes to the tooltip before:z-50 before:content-[attr(data-tip)]

        <div
          class="before:z-50 before:content-[attr(data-tip)] tooltip tooltip-bottom tooltip-accent block"
          data-tip="HELLO WORLD"
        >
          hello world
        </div>
        <div
          class="before:z-50 before:content-[attr(data-tip)] tooltip tooltip-top tooltip-accent block"
          data-tip="GOOD NIGHT MOON"
        >
          good night good night good night
        </div>

@dennisjlee
Copy link
Author

dennisjlee commented Dec 2, 2022 via email

inorganik pushed a commit to inorganik/daisyui that referenced this issue Feb 7, 2023
imgbot bot pushed a commit to Avensen/daisyui that referenced this issue Jun 5, 2023
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

No branches or pull requests

2 participants