How to use @polymer/iron-a11y-announcer - 3 common examples

To help you get started, we’ve selected a few @polymer/iron-a11y-announcer 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 MyScript / myscript-math-web / docs / components / iron-a11y-announcer / iron-a11y-announcer.js View on Github external
created: function() {
    if (!IronA11yAnnouncer$0.instance) {
      IronA11yAnnouncer$0.instance = this;
    }

    document.body.addEventListener('iron-announce', this._onIronAnnounce.bind(this));
  },
github MyScript / myscript-math-web / docs / components / iron-a11y-announcer / iron-a11y-announcer.js View on Github external
created: function() {
    if (!IronA11yAnnouncer$0.instance) {
      IronA11yAnnouncer$0.instance = this;
    }

    document.body.addEventListener('iron-announce', this._onIronAnnounce.bind(this));
  },
github MyScript / myscript-math-web / docs / components / iron-a11y-announcer / iron-a11y-announcer.js View on Github external
this._text = '';
    this.async(function() {
      this._text = text;
    }, 100);
  },

  _onIronAnnounce: function(event) {
    if (event.detail && event.detail.text) {
      this.announce(event.detail.text);
    }
  }
});

IronA11yAnnouncer$0.instance = null;

IronA11yAnnouncer$0.requestAvailability = function() {
  if (!IronA11yAnnouncer$0.instance) {
    IronA11yAnnouncer$0.instance = document.createElement('iron-a11y-announcer');
  }

  document.body.appendChild(IronA11yAnnouncer$0.instance);
};

@polymer/iron-a11y-announcer

A singleton element that simplifies announcing text to screen readers.

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis