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

Proper positioning of Tooltip in example of sidebar #33753

Closed
wants to merge 3 commits into from

Conversation

sanyogchangmai
Copy link

@sanyogchangmai sanyogchangmai commented Apr 26, 2021

fixes #33748

Problem - The tooltip does not get aligned to the respective option in the sidebar instead it appeared at the top of the sidebar.

After Solving - The tooltip is properly positioned with the respective option present in the sidebar.

Changes made - removed min-height property from sidebars.css

@alpadev
Copy link
Contributor

alpadev commented Apr 26, 2021

To elaborate on this fix a bit more. We use height: -webkit-fill-available on the body and min-height: -webkit-fill-available on every child element of that body (including the tooltip element). This causes the tooltip to grow to the height of the viewport thus popper is using wrong dimensions when it tries to position that tooltip.

While trying to figure out why we use height: -webkit-fill-available in addition to height: 100vh on the body, I found this article which suggests that there was a problem with that page on mobiles.

The snippet in that article is a bit different tho. Instead of setting height: -webkit-fill-available on the body they set it on the html element and use min-height for the body. I guess the intention behind using min-height rather than height is to make the body scrollable, while our body uses overflow-y: hidden to prevent this, so this makes sense I guess.

The thing is I'm not sure why it was moved one level down e.g.

Snippet Us
html { height } body { height }
body { min-height } body > * { min-height }

I found that the page looks frankly different when applying height: -webkit-fill-availble to the html element.

body:
body

html:
html

@sanyogchangmai
Copy link
Author

Someone please approve my pull request.

@mdo
Copy link
Member

mdo commented May 6, 2021

This PR doesn't fix the issue properly—it introduces more problems in mobile and other browsers. See #33859 for a (hopefully) more complete fix for the whole example.

@mdo mdo closed this May 6, 2021
@simevidas
Copy link

Have you considered this?

html, body, main {
    height: 100%; /* or min-height */
}

I don’t understand why -webkit-fill-available would be needed when height 100% makes the element cover the entire initial viewport just the same. It feels to me that somebody on Twitter mentioned -webkit-fill-available as a solution, and then a bunch of blogs wrote about it, and then many people started using it, but nobody thought to think if a simple 100% solves the problem (it does).

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

Successfully merging this pull request may close these issues.

Tooltip is going upside in example of sidebar
5 participants