new dialogPolyfillInfo(dialognon-null)
Parameters:
Name | Type | Description |
---|---|---|
dialog |
HTMLDialogElement | to upgrade |
Methods
backdropMouseEvent_(enon-null)
Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if
they were on the dialog itself.
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | to redirect |
close(opt_returnValueopt)
Closes this HTMLDialogElement. This is optional vs clearing the open
attribute, however this fires a 'close' event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opt_returnValue |
string |
<optional> |
to use as the returnValue |
downgradeModal()
Remove this dialog from the modal top layer, leaving it as a non-modal.
focus_()
Focuses on the first focusable element within the dialog. This will always blur the current
focus, even if nothing within the dialog is found.
maybeHideModal()
Maybe remove this dialog from the modal top layer. This is called when
a modal dialog may no longer be tenable, e.g., when the dialog is no
longer open or is no longer part of the DOM.
setOpen(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | whether to open or close this dialog |
show()
Shows the dialog. If the dialog is already open, this does nothing.
showModal()
Show this dialog modally.
updateZIndex(dialogZ, backdropZ)
Sets the zIndex for the backdrop and dialog.
Parameters:
Name | Type | Description |
---|---|---|
dialogZ |
number | |
backdropZ |
number |