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

The "fixed" class no longer positions correctly in Chrome #220

Open
rajsite opened this issue May 2, 2021 · 3 comments
Open

The "fixed" class no longer positions correctly in Chrome #220

rajsite opened this issue May 2, 2021 · 3 comments

Comments

@rajsite
Copy link

rajsite commented May 2, 2021

Using the provided fixed class in Chrome no longer centers the dialog in the middle of the page in Chrome. I think it is due to a change in style for dialog elements in Chrome.

Here is an example page and a screenshot using Chrome 90 and Firefox 88.

Chrome 90:

image

Firefox 88:

image

It looks like the dialog:-internal-modal pseudoelement has bottom: 0 set which is impacting the style:
image

@inopinatus
Copy link

agreed, native chrome gets it right, but looks like loading the 0.5.6 polyfill CSS intrudes on the native styles, and position goes sideways.

or rather, in my apps, up.

@IanVS
Copy link

IanVS commented Aug 4, 2021

Adding the following to my css seems to result in a decent positioning in chrome, firefox, and safari:

dialog.fixed {
  bottom: 50%;
  transform: none;
}

edit: nevermind, that breaks firefox, placing the modal too low. Not sure how to work around this one...

@xtools-at
Copy link

xtools-at commented Sep 13, 2021

try this

/* Chromium Only */
@supports (contain: paint) and (not (-moz-appearance: none)) {
    dialog.fixed {
        top: 0;
        transform: none;
    }
}

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

4 participants