How to use a11y-dialog - 3 common examples

To help you get started, we’ve selected a few a11y-dialog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / a11y-dialog_v5.x.x / flow_v0.104.x- / test_a11y-dialog_v5.x.x.js View on Github external
// @flow

import { describe, it } from "flow-typed-test";
import A11yDialog from "a11y-dialog";

let el = document.getElementById("my-accessible-dialog");
let containers = document.querySelectorAll("container");
let dialog;
if (el instanceof HTMLElement) {
  dialog = new A11yDialog(el);
}

describe("The `dialog` property", () => {
  it("should validate on default usage", () => {
    if (dialog.dialog instanceof HTMLDialogElement) {
      (dialog.dialog.open: boolean);
      (dialog.dialog.returnValue: string);
      (dialog.dialog.show: Function);
      (dialog.dialog.showModal: Function);
      (dialog.dialog.close: Function);
    }
  });
});
github hashicorp / consul / ui / packages / consul-ui / app / components / modal-dialog / index.js View on Github external
connect: function($el) {
      this.dialog = new A11yDialog($el);
      this.dialog.on('hide', () => this.onclose({ target: $el }));
      this.dialog.on('show', () => this.onopen({ target: $el }));
    },
    disconnect: function($el) {
github ONSdigital / sdc-global-design-patterns / assets / js / dialog.js View on Github external
init: () => {
    const dialogEl = document.querySelector('.js-dialog')

    if (!dialogEl) return

    a11ydialog = new A11yDialog(dialogEl)

    a11ydialog.on('show', (dialogEl) => {
      dialogEl.classList.remove('is-hidden')
    })

    a11ydialog.on('hide', (dialogEl) => {
      dialogEl.classList.add('is-hidden')
    })
  }
}

a11y-dialog

A tiny script to make dialog windows accessible to assistive technology users.

MIT
Latest version published 7 months ago

Package Health Score

82 / 100
Full package analysis

Popular a11y-dialog functions