ConfirmDialog uses a Dialog UI that is integrated with the Confirmation API.
ConfirmDialog is controlled via the ConfirmationService that needs to be installed as an application plugin.
The service is available with the useConfirm function for Composition API or using the $confirm property of the application for Options API.
ConfirmDialog is displayed by calling the require method of the $confirm instance by passing the options to customize the Dialog. The target attribute is mandatory to align the popup to its referrer.
The position property of the confirm options specifies the location of the Dialog.
Templating allows customizing the message content.
Headless mode is enabled by defining a container slot that lets you implement entire confirmation UI instead of the default elements.
ConfirmDialog component uses alertdialog role along with aria-labelledby referring to the header element however any attribute is passed to the root element so you may use aria-labelledby to override this default behavior. In addition aria-modal is added since focus is kept within the popup.
When require method of the $confirm instance is used and a trigger is passed as a parameter, ConfirmDialog adds aria-expanded state attribute and aria-controls to the trigger so that the relation between the trigger and the dialog is defined.
Key | Function |
---|---|
tab | Moves focus to the next the focusable element within the dialog. |
shift + tab | Moves focus to the previous the focusable element within the dialog. |
escape | Closes the dialog. |
Key | Function |
---|---|
enter | Closes the dialog. |
space | Closes the dialog. |