react-aria-modal
Advanced tools
Comparing version 2.10.0 to 2.11.0
# Changelog | ||
## 2.11.0 | ||
- Add `scrollDisabled` prop (default `true`), for edge cases when the document's scroll should not be disabled. | ||
## 2.10.0 | ||
@@ -4,0 +8,0 @@ |
@@ -53,3 +53,6 @@ 'use strict'; | ||
} | ||
noScroll.on(); | ||
if (this.props.scrollDisabled) { | ||
noScroll.on(); | ||
} | ||
} | ||
@@ -79,3 +82,5 @@ }, { | ||
value: function componentWillUnmount() { | ||
noScroll.off(); | ||
if (this.props.scrollDisabled) { | ||
noScroll.off(); | ||
} | ||
var applicationNode = this.getApplicationNode(); | ||
@@ -225,3 +230,4 @@ if (applicationNode) { | ||
includeDefaultStyles: true, | ||
focusTrapPaused: false | ||
focusTrapPaused: false, | ||
scrollDisabled: true | ||
}; | ||
@@ -228,0 +234,0 @@ |
{ | ||
"name": "react-aria-modal", | ||
"version": "2.10.0", | ||
"version": "2.11.0", | ||
"description": "A fully accessible and flexible React modal built according WAI-ARIA Authoring Practices", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-aria-modal.js", |
@@ -10,3 +10,3 @@ # react-aria-modal | ||
- Escape will close the modal. | ||
- Scrolling is frozen on the main document beneath the modal. (Although, sadly, you can still mess with the scrolling using a touch screen.) | ||
- Scrolling is frozen on the main document beneath the modal. | ||
- When the modal closes, focus returns to the element that was focused just before the modal activated. | ||
@@ -350,2 +350,8 @@ - The dialog element has an ARIA `role` of `dialog` (or `alertdialog`). | ||
### scrollDisabled | ||
Type: `boolean`, Default: `true` | ||
If `true`, the modal dialog will prevent any scrolling behind the modal window. | ||
## AriaModal.renderTo(HTMLElement | string) | ||
@@ -352,0 +358,0 @@ |
@@ -14,3 +14,4 @@ const React = require('react'); | ||
includeDefaultStyles: true, | ||
focusTrapPaused: false | ||
focusTrapPaused: false, | ||
scrollDisabled: true | ||
}; | ||
@@ -24,3 +25,6 @@ | ||
} | ||
noScroll.on(); | ||
if (this.props.scrollDisabled) { | ||
noScroll.on(); | ||
} | ||
} | ||
@@ -48,3 +52,5 @@ | ||
componentWillUnmount() { | ||
noScroll.off(); | ||
if (this.props.scrollDisabled) { | ||
noScroll.off(); | ||
} | ||
const applicationNode = this.getApplicationNode(); | ||
@@ -51,0 +57,0 @@ if (applicationNode) { |
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
162642
391
406