react-aria-modal
Advanced tools
Comparing version 2.11.1 to 2.12.0
# Changelog | ||
## 2.12.0 | ||
- Add `focusTrapOptions` prop to pass options to the focus trap. | ||
## 2.11.1 | ||
@@ -4,0 +8,0 @@ |
@@ -209,6 +209,9 @@ 'use strict'; | ||
var focusTrapOptions = props.focusTrapOptions || {}; | ||
if (props.focusDialog || props.initialFocus) { | ||
focusTrapOptions.initialFocus = props.focusDialog ? '#' + this.props.dialogId : props.initialFocus; | ||
} | ||
return React.createElement(FocusTrap, { | ||
focusTrapOptions: { | ||
initialFocus: props.focusDialog ? '#' + this.props.dialogId : props.initialFocus | ||
}, | ||
focusTrapOptions: focusTrapOptions, | ||
paused: props.focusTrapPaused | ||
@@ -215,0 +218,0 @@ }, React.createElement('div', underlayProps, childrenArray)); |
{ | ||
"name": "react-aria-modal", | ||
"version": "2.11.1", | ||
"version": "2.12.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", |
@@ -349,2 +349,9 @@ # react-aria-modal | ||
### focusTrapOptions | ||
Type: `object` | ||
Customize properties of the `focusTrapOptions` prop that is passed to the modal dialog's [focus trap](https://github.com/davidtheclark/focus-trap). | ||
For example, you can use this prop if you need better control of where focus is returned. | ||
### scrollDisabled | ||
@@ -351,0 +358,0 @@ |
@@ -201,9 +201,12 @@ const React = require('react'); | ||
const focusTrapOptions = props.focusTrapOptions || {}; | ||
if (props.focusDialog || props.initialFocus) { | ||
focusTrapOptions.initialFocus = props.focusDialog | ||
? `#${this.props.dialogId}` | ||
: props.initialFocus | ||
} | ||
return React.createElement(FocusTrap, | ||
{ | ||
focusTrapOptions: { | ||
initialFocus: props.focusDialog | ||
? `#${this.props.dialogId}` | ||
: props.initialFocus | ||
}, | ||
focusTrapOptions, | ||
paused: props.focusTrapPaused | ||
@@ -210,0 +213,0 @@ }, |
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
173192
395
413