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

When a tooltip is visible and you start scrolling, the tooltip appears above other elements. #6209

Closed
3 tasks done
hanneswylaers opened this issue Jan 27, 2022 · 4 comments · Fixed by #6234
Closed
3 tasks done
Labels

Comments

@hanneswylaers
Copy link

hanneswylaers commented Jan 27, 2022

Prerequisites

Describe the bug

When a tooltip appears within a container and you start scrolling the container away, the tooltip appears above any other elements on the page.

Expected behavior

When a tooltip appears within a container and you start scrolling the container, the tooltip should only be visible within the container and not appear above any other elements on the page.

To Reproduce

1: Go to https://react-bootstrap.github.io/components/overlays/#examples
2: Go to example of 'You can pass the Overlay injected props directly to the Tooltip component.' and click on the button to show the tooltip.
3: Start scrolling the entire page.
4: When you scroll the button with the tooltip away, the tooltip appears above the header

Reproducible Example

The issue is visible on the website, see https://react-bootstrap.github.io/components/overlays/#examples.

Screenshots

tooltip issue

tooltip issue_B

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

What version of React-Bootstrap are you using?

The issue is visible on the website

What version of Bootstrap are you using?

The issue is visible on the website

Additional context

If I apply 'z-index: 0;' to '.tooltip', the issue seems to be fixed.

@golota60
Copy link
Collaborator

Hi! According to bootstrap styling it is expected to work like that. tooltip class applies z-index: 1080 by default. You can change this by adjusting $zindex-tooltip scss variable
https://getbootstrap.com/docs/5.1/components/tooltips/

@watinha
Copy link
Contributor

watinha commented Feb 5, 2022

Hello everyone! In this case, would it make sense to increase the z-index of the header of the docs webpage, so that the tooltips do not hover it?

@hanneswylaers
Copy link
Author

hanneswylaers commented Mar 15, 2022

@kyletsang FYI: increasing the z-index of the header isn't really solving this issue.
Instead, it introduces other unwanted side effects e.g. when opening a modal, the modal appears under the header.
See the examples on https://react-bootstrap.github.io/components/modal/.

Since I see similar issues at bootstrap side, I guess this issue isn't coming from react-bootstrap.
I left a comment on a similar issue on the bootstrap repo, see twbs/bootstrap#35202 (comment)

@kyletsang
Copy link
Member

Forgot about the modal being affected by this. I'll revert the change on the docs.

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