Accessibility in Vue Dialog component

16 Mar 20236 minutes to read

The Dialog characterized with complete ARIA Accessibility support which helps to accessible by on-screen readers and other assistive technology devices. This component designed with the reference of the guidelines document given in WAI ARAI Accessibility Practices.

The Dialog component uses the Dialog role and following ARIA properties to its element based on its state.

Property Functionalities
aria-describedby It indicates the Dialog content description is notified to the user through assistive technologies.
aria-labelledby The Dialog title is notified to the user through assistive technologies.
aria-modal For modal dialog it’s value is true and non-modal dialog its value is false
aria-grabbed Enable the draggable Dialog and starts dragging it is value is true and stopping the drag its value is false

Keyboard interaction

Keyboard interaction of Dialog component has designed based on WAI-ARIA Practices described for Dialog. User can use the following shortcut keys to interact with the Dialog.

Keyboard shortcuts Actions
Esc Closes the Dialog. This functionality can be controlled by using `closeOnEscape`
Enter When the Dialog button or any input (except text area) is in focus state, when pressing the Enter key, the click event associated with the primary button or button will trigger. Enter key is not working when the Dialog content contains any text area with initial focus
Ctrl + Enter When the Dialog content contains text area and it is in focus state, and press the Ctrl + Enter key to call the click event function associated with primary button
Tab Focus will be changed within the Dialog elements
Shift + Tab The Focus will be changed previous focusable element within the Dialog elements. When focusing a first focusable element in the Dialog, then press the shift + tab key, it will change the focus to last focusable element
    <div id="target" class="control-section; position:relative" style="height:350px;">

        <ejs-button id='modalbtn' v-on:click.native="btnClick">Open</ejs-button>

        <ejs-dialog ref="accessDialog" :header='header' :target='target' :width='width' :height='height' :showCloseIcon='true'  :buttons='buttons' :content='content' :open="dlgOpen" :close="dlgClose">
import Vue from "vue";
import { DialogPlugin } from '@syncfusion/ej2-vue-popups';
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons';

export default {
    data: function() {
        return {
            target: '#target',
            width: '335px',
            height: '350px',
            header: 'Feedback',
            content: "<form><div class='form-group'><label for='email'>Email:</label>" +
                "<input type='email' class='form-control' id='email'>" +
                "</div><div class='form-group'>" +
                "</div><div class='form-group'><label for='comment'>Comments:</label>" +
                "<textarea style='resize: none;' class='form-control' rows='4' id='comment'></textarea>" +
                "</div>" +
            buttons: [{ click: this.dlgButtonClick, buttonModel: { content: 'OK', isPrimary: true } },
            { click: this.dlgButtonClick, buttonModel: { content: 'Cancel' }}]
    mounted: function(){
    methods: {
        btnClick: function() {
        dlgClose: function() {
            document.getElementById('modalbtn').style.display = '';
        dlgOpen: function() {
            document.getElementById('modalbtn').style.display = 'none';
        dlgButtonClick: function() {
@import "../../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
@import "";
    #app {
        color: #008cff;
        height: 40px;
        left: 45%;
        position: absolute;
        top: 45%;
        width: 30%;
    .control-section {
        height: 100%;
        min-height: 200px;

See Also