dialog-polyfill icon indicating copy to clipboard operation
dialog-polyfill copied to clipboard

The "fixed" class no longer positions correctly in Chrome

Open rajsite opened this issue 3 years ago • 3 comments

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

rajsite avatar May 02 '21 23:05 rajsite

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.

inopinatus avatar May 10 '21 02:05 inopinatus

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...

IanVS avatar Aug 04 '21 18:08 IanVS

try this

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

xtools-at avatar Sep 13 '21 22:09 xtools-at