Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// - Chrome 70
// - Firefox 60 (ESR)
// - IE 11
// * NVDA 2018:
// - Chrome 70
// - Firefox 60 (ESR)
// - IE 11
// * ChromeVox 53
this.showLabelText = false;
// Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element.
// CSS generated content is normally announced by screen readers
// (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/);
// however, `aria-live` is turned off, so this DOM update will be ignored by screen readers.
labelEl.setAttribute(
MDCSnackbarFoundation.strings.ARIA_LIVE_LABEL_TEXT_ATTR,
this.labelText,
);
setTimeout(() => {
// Allow screen readers to announce changes to the DOM again.
ariaEl.setAttribute('aria-live', priority);
// Remove the message from the ::before pseudo-element.
labelEl.removeAttribute(
MDCSnackbarFoundation.strings.ARIA_LIVE_LABEL_TEXT_ATTR,
);
// Restore the original label text, which will be announced by screen readers.
this.showLabelText = true;
}, MDCSnackbarFoundation.numbers.ARIA_LIVE_DELAY_MS);
},
notifyOpening: () =>
this.$emit(MDCSnackbarFoundation.strings.OPENING_EVENT, {}),
notifyOpened: () => {