showModalDialog icon indicating copy to clipboard operation
showModalDialog copied to clipboard

Dialog position in FF

Open psined1 opened this issue 6 years ago • 5 comments

Unlike Chrome, where the dialog is perfectly centered across the screen horizontally and vertically, in FireFox, the dialog is pushed all the way down underneath the page content, so, at times, it falls outside of the page viewable area.

Can this be improved by some CSS maybe?

Also, unlike Chrome, the dialog in FF is not modal at all. It allows user interact with other controls on the form, so dialog essentially acts nothing short of a div element. Sounds like dialog suffers from sheer implementation lackluster in FF.

psined1 avatar Jul 12 '18 21:07 psined1

You have to set dom.dialog_element.enabled to true in about:config to enable <dialog> element or use a polyfill.

niutech avatar Jul 12 '18 23:07 niutech

Yes, already did. That took care of dialog DOM support. Alas, it offers little help to my issue...

psined1 avatar Jul 13 '18 04:07 psined1

Worse yet, because FF dialog is not modal, it is possible to invoke the dialog more than once. Although this still results in one and only visible dialog on the screen, it is not possible to close the dialog without refreshing the page anymore. Demo page tested with FF for Mac 61.0.1 and FF for Windows 61.0.1 -

  1. click either button for the dialog to show, the dialog shows up, "Dialog argments: some argument"
  2. click once more either button for the dialog to show, this time with "Dialog argments: undefined"
  3. Attempt to close the dialog, nothing happens
  4. Refresh the page to start over

psined1 avatar Jul 13 '18 15:07 psined1

This is because Firefox does not support modal dialogs or dialog backdrop yet. As a workaround, set the preference: dom.disable_window_showModalDialog to false in about:config in order to restore the native showModalDialog() function or use a dialog polyfill.

niutech avatar Jul 17 '18 21:07 niutech

Thanks. Did that. Still the behavior is the same.

psined1 avatar Jul 19 '18 17:07 psined1