Open keithamus opened 2 hours ago
Dialog's show method: https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-show
If this has an open attribute and the is modal flag of this is false, then return. If this has an open attribute, then throw an "InvalidStateError" DOMException. Add an open attribute to this, whose value is the empty string. Set this's previously focused element to the focused element. Let hideUntil be the result of running topmost popover ancestor given this, null, and false. If hideUntil is null, then set hideUntil to this's node document. Run hide all popovers until given hideUntil, false, and true. Run the dialog focusing steps given this.
Step 6 & 7 show that a dialog, not shown as modal, will close all popovers.
Dialog's show() method also does not check for connectedness. This means in an active document, the following script can cause all popovers to hide:
show()
document.createElement('dialog').show()
This seems strange as there's no observable change to UI being performed by the Dialog, and yet it is closing all popovers as a side effect.
Perhaps between step 3 and 4 we should add a check like: If this is not connected, then return.?
If this is not connected, then return.
/cc @josepharhar
I'd expect consistency with showModal() which has the connected check.
What is the issue with the HTML Standard?
Dialog's show method: https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-show
Step 6 & 7 show that a dialog, not shown as modal, will close all popovers.
Dialog's
show()
method also does not check for connectedness. This means in an active document, the following script can cause all popovers to hide:This seems strange as there's no observable change to UI being performed by the Dialog, and yet it is closing all popovers as a side effect.
Perhaps between step 3 and 4 we should add a check like:
If this is not connected, then return.
?/cc @josepharhar