diff --git a/lib/components/TrayPortal.js b/lib/components/TrayPortal.js index 317ec42..742dfcf 100644 --- a/lib/components/TrayPortal.js +++ b/lib/components/TrayPortal.js @@ -105,12 +105,12 @@ export default React.createClass({ this.refs.content.focus(); }, - toggleAriaHidden(element) { - if (!element.getAttribute('aria-hidden')) { - element.setAttribute('aria-hidden', true); - } else { - element.removeAttribute('aria-hidden'); - } + applyAriaHidden(element) { + element.setAttribute('aria-hidden', true); + }, + + removeAriaHidden(element) { + element.removeAttribute('aria-hidden'); }, handleOverlayClick(e) { @@ -148,7 +148,7 @@ export default React.createClass({ this.props.onOpen(); } if (this.props.getAriaHideElement) { - this.toggleAriaHidden(this.props.getAriaHideElement()); + this.applyAriaHidden(this.props.getAriaHideElement()); } this.setState({afterOpen: true}); }); @@ -161,7 +161,7 @@ export default React.createClass({ this.closeWithoutTimeout(); } if (this.props.getAriaHideElement) { - this.toggleAriaHidden(this.props.getAriaHideElement()); + this.removeAriaHidden(this.props.getAriaHideElement()); } },