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

Problem with overflow for dialog tooltips #6

Closed
beauwest opened this issue May 10, 2022 · 10 comments
Closed

Problem with overflow for dialog tooltips #6

beauwest opened this issue May 10, 2022 · 10 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@beauwest
Copy link

beauwest commented May 10, 2022

Hey! Tooltips for the entity detail dialogs are cut off instead of overflowing their container.

Behavior

Screen Shot 2022-05-10 at 8 13 08 AM

Expected

Screen Shot 2022-05-10 at 8 16 14 AM

@Madelena Madelena added the bug Something isn't working label May 11, 2022
@Madelena
Copy link
Owner

Madelena commented May 11, 2022

Hmmmmmm I'm stumped on this one. After commenting out a bunch of codes to trace the bug, I've come to the conclusion that CSS backdrop-filter and filter breaks how it handles overflow of a block.

I did manage to fix it by disabling the overflow-y property of .mdc-dialog__surface and .content. But the problem is that sometimes cards do overflow (e.g. when it has a lot of attributes) so I can't fix it this way...

If anyone had experience fixing this one, please let me know!

@beauwest
Copy link
Author

I'm looking into it too, it has something to do with the .mdc-dialog__surface::before, but I can't figure out the differences yet. The position: absolute and width/height: 100% is supposed to be based on the entire page, but right now it's based on the dialog element.

I have to get to work, but if I have time, I'll dig into it more.

@Madelena
Copy link
Owner

The solution here will temporarily fix the scrollbar problem, but you lose the transparency blur in the process:

#7

@Madelena Madelena added the help wanted Extra attention is needed label May 16, 2022
@zanix
Copy link
Contributor

zanix commented Aug 24, 2022

I stumbled on a partial solution, it fixes overflow for tooltips while retaining the blur effect

Tooltip Overflow - Light Mode
Tooltip Overflow - Dark Mode

  card-mod-more-info-yaml: &card-mod-more-info-yaml |
    $: |
      @supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
        .mdc-dialog__surface {
          backdrop-filter: blur(16px);
          -webkit-backdrop-filter: blur(16px);
          background-color: rgba(var(--rgb-mdc-theme-surface), .5) !important;
        }
      }
      .mdc-dialog .mdc-dialog__container .mdc-dialog__surface {
        overflow: visible;
      }
      .mdc-dialog__surface {
        box-shadow: 0 0px 16px 4px rgba(var(--dialog-box-shadow), .15), 0 16px 64px 32px rgba(var(--dialog-box-shadow), .5) !important;
      }

However, dropdowns render incorrectly but it makes them more usable than before as noted in #28

Dropdown - Dark Mode

I am no CSS expert, but if I remove the top and left style properties from this element, it returns to the proper position. I'm not sure how to apply this fix to the CSS though.

Inspect

Position Fixed

@Madelena
Copy link
Owner

Cool! Thank you and let me try this fix out.

@zanix
Copy link
Contributor

zanix commented Sep 9, 2022

Dropdowns seem to have been almost fixed with Home Assistant v2022.9.0 when using the overflow fix
image

Without the overflow fix, dropdowns cause scrollbars to show, but still show (almost) in the correct location
image

And the tooltips causing scrollbars still occur without the overflow fix
image

@Madelena
Copy link
Owner

Madelena commented Jan 4, 2023

It's probably not an issue anymore since HA 2022.10 changed all the dialogs.

image

@Madelena Madelena closed this as completed Jan 4, 2023
@zanix
Copy link
Contributor

zanix commented Jan 4, 2023

The overflow issue is still present for me on HA 2022.12
Nevermind, the fix is in v1.8

image

image

@zanix
Copy link
Contributor

zanix commented Jan 4, 2023

Ah, I see my fix was added to v1.8

@mmalolepszy
Copy link

I had an issue with overflows and after manually applying a fix from @zanix it now looks like this:
obraz

What can I do about it?

I'm on HA 2022.12.9 and Metrology 1.7.2 installed via HACS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants