react-aria-modal
Advanced tools
Comparing version 2.1.0 to 2.2.0
# Changelog | ||
## 2.2.0 | ||
- Add `applicationNode` prop. | ||
## 2.1.0 | ||
@@ -4,0 +8,0 @@ |
@@ -26,2 +26,3 @@ var React = require('react'); | ||
initialFocus='#demo-one-deactivate' | ||
applicationNode={document.getElementById('application')} | ||
> | ||
@@ -28,0 +29,0 @@ <div id='demo-one-modal' className='modal'> |
@@ -25,2 +25,5 @@ var React = require('react'); | ||
verticallyCenter: PropTypes.bool, | ||
applicationNode: PropTypes.shape({ | ||
setAttribute: PropTypes.func.isRequired, | ||
}), | ||
}, | ||
@@ -47,2 +50,8 @@ | ||
} | ||
// Timeout to ensure this happens *after* focus has moved | ||
setTimeout(function() { | ||
if (this.props.applicationNode) { | ||
this.props.applicationNode.setAttribute('aria-hidden', 'true'); | ||
} | ||
}, 0); | ||
}, | ||
@@ -52,2 +61,5 @@ | ||
noScroll.off(); | ||
if (this.props.applicationNode) { | ||
this.props.applicationNode.setAttribute('aria-hidden', 'false'); | ||
} | ||
}, | ||
@@ -54,0 +66,0 @@ |
{ | ||
"name": "react-aria-modal", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "A fully accessible and flexible React modal built according WAI-ARIA Authoring Practices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -133,2 +133,10 @@ # react-aria-modal | ||
### applicationNode | ||
Type: `DOM Node` | ||
Provide your main application node here (which the modal should render outside of), and when the modal is open this application node will receive the attribute `aria-hidden="true"`. This [can help screen readers understand what's going on](https://www.w3.org/WAI/GL/wiki/Using_ARIA_role%3Ddialog_to_implement_a_modal_dialog_box#Description). | ||
This module can't guess your application node, so you have to provide this prop to get the full accessibility benefit. | ||
### alert | ||
@@ -135,0 +143,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39735
564
313