Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getDefaultFoundation() {
// prettier-ignore
return new MDCSnackbarFoundation({
addClass: helper.addClass('rootProps', this),
removeClass: helper.removeClass('rootProps', this),
setAriaHidden: helper.setAttr('rootProps', this, 'aria-hidden', true),
unsetAriaHidden: helper.rmAttr('rootProps', this, 'aria-hidden', false),
setActionAriaHidden: helper.setAttr('actionButtonProps', this, 'aria-hidden', true),
unsetActionAriaHidden: helper.rmAttr('actionButtonProps', this, 'aria-hidden', false),
setActionText: actionText => this.setState({ actionText }),
setMessageText: messageText => this.setState({ messageText }),
setFocus: () => this.actionButton_.focus(),
visibilityIsHidden: () => document.hidden,
registerCapturedBlurHandler: helper.registerHandler('actionButtonProps', this, 'blur'),
deregisterCapturedBlurHandler: helper.deregisterHandler('actionButtonProps', this, 'blur'),
registerVisibilityChangeHandler: (handler) => document.addEventListener('visibilitychange', handler),
deregisterVisibilityChangeHandler: (handler) => document.removeEventListener('visibilitychange', handler),
registerCapturedInteractionHandler: (evt, handler) =>
document.body.addEventListener(evt, handler, true),