focus-trap-react
Advanced tools
Comparing version 8.9.2 to 8.10.0
# Changelog | ||
## 8.10.0 | ||
### Minor Changes | ||
- 659d44e: Bumps focus-trap to v6.8.1. The big new feature is opt-in Shadow DOM support in focus-trap (in tabbable), and new tabbable options exposed in a new `focusTrapOptions.tabbableOptions` configuration option. | ||
## 8.9.2 | ||
@@ -4,0 +10,0 @@ |
@@ -342,3 +342,7 @@ "use strict"; | ||
allowOutsideClick: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), | ||
preventScroll: PropTypes.bool | ||
preventScroll: PropTypes.bool, | ||
tabbableOptions: PropTypes.shape({ | ||
displayCheck: PropTypes.oneOf(['full', 'non-zero-area', 'none']), | ||
getShadowRoot: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]) | ||
}) | ||
}), | ||
@@ -345,0 +349,0 @@ containerElements: PropTypes.arrayOf(PropTypes.instanceOf(ElementType)), |
{ | ||
"name": "focus-trap-react", | ||
"version": "8.9.2", | ||
"version": "8.10.0", | ||
"description": "A React component that traps focus.", | ||
@@ -31,2 +31,3 @@ "main": "dist/focus-trap-react.js", | ||
"prepare": "yarn build", | ||
"prepublishOnly": "yarn test && yarn build", | ||
"release": "yarn build && changeset publish" | ||
@@ -59,4 +60,4 @@ }, | ||
"devDependencies": { | ||
"@babel/cli": "^7.17.0", | ||
"@babel/core": "^7.17.2", | ||
"@babel/cli": "^7.17.6", | ||
"@babel/core": "^7.17.9", | ||
"@babel/eslint-parser": "^7.17.0", | ||
@@ -66,9 +67,9 @@ "@babel/plugin-proposal-class-properties": "^7.16.5", | ||
"@babel/preset-react": "^7.16.7", | ||
"@changesets/cli": "^2.20.0", | ||
"@changesets/cli": "^2.22.0", | ||
"@testing-library/cypress": "^8.0.2", | ||
"@testing-library/dom": "^8.11.3", | ||
"@testing-library/jest-dom": "^5.16.2", | ||
"@testing-library/react": "^12.1.2", | ||
"@testing-library/user-event": "^13.5.0", | ||
"@types/jquery": "^3.5.13", | ||
"@testing-library/dom": "^8.13.0", | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@testing-library/react": "^13.1.1", | ||
"@testing-library/user-event": "^14.1.1", | ||
"@types/jquery": "^3.5.14", | ||
"all-contributors-cli": "^6.20.0", | ||
@@ -78,22 +79,22 @@ "babel-jest": "^27.5.1", | ||
"browserify": "^17.0.0", | ||
"budo": "^11.6.4", | ||
"cypress": "^9.4.1", | ||
"budo": "^11.7.0", | ||
"cypress": "^9.5.4", | ||
"cypress-plugin-tab": "^1.0.5", | ||
"eslint": "^8.8.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint": "^8.13.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-cypress": "^2.12.1", | ||
"eslint-plugin-react": "^7.28.0", | ||
"eslint-plugin-react": "^7.29.4", | ||
"jest": "^27.5.1", | ||
"jest-watch-typeahead": "^1.0.0", | ||
"onchange": "^7.1.0", | ||
"prettier": "^2.5.1", | ||
"prettier": "^2.6.2", | ||
"prop-types": "^15.8.1", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react": "^18.0.0", | ||
"react-dom": "^18.0.0", | ||
"regenerator-runtime": "^0.13.9", | ||
"start-server-and-test": "^1.14.0", | ||
"typescript": "^4.5.5" | ||
"typescript": "^4.6.3" | ||
}, | ||
"dependencies": { | ||
"focus-trap": "^6.7.3" | ||
"focus-trap": "^6.8.1" | ||
}, | ||
@@ -100,0 +101,0 @@ "peerDependencies": { |
@@ -144,4 +144,6 @@ # focus-trap-react [![CI](https://github.com/focus-trap/focus-trap-react/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/focus-trap/focus-trap-react/actions?query=workflow:CI+branch:master) [![Codecov](https://img.shields.io/codecov/c/github/focus-trap/focus-trap-react)](https://codecov.io/gh/focus-trap/focus-trap-react) [![license](https://badgen.now.sh/badge/license/MIT)](./LICENSE) | ||
Pass any of the options available in [`focus-trap`'s `createOptions`](https://github.com/focus-trap/focus-trap#focustrap--createfocustrapelement-createoptions). | ||
Pass any of the options available in focus-trap's [createOptions](https://github.com/focus-trap/focus-trap#createoptions). | ||
> ⚠️ See notes about __[testing in JSDom](#testing-in-jsdom)__ (e.g. using Jest) if that's what you currently use. | ||
#### active | ||
@@ -173,2 +175,16 @@ | ||
## Help | ||
### Testing in JSDom | ||
> ⚠️ JSDom is not officially supported. Your mileage may vary, and tests may break from one release to the next (even a patch or minor release). | ||
> | ||
> This topic is just here to help with what we know may affect your tests. | ||
In general, a focus trap is best tested in a full browser environment such as Cypress, Playwright, or Nightwatch where a full DOM is available. | ||
Sometimes, that's not entirely desirable, and depending on what you're testing, you may be able to get away with using JSDom (e.g. via Jest), but you'll have to configure your traps using the `focusTrapOptions.tabbableOptions.displayCheck: 'none'` option. | ||
See [Testing focus-trap in JSDom](https://github.com/focus-trap/focus-trap#testing-in-jsdom) for more details. | ||
## Contributing | ||
@@ -175,0 +191,0 @@ |
@@ -314,2 +314,6 @@ const React = require('react'); | ||
preventScroll: PropTypes.bool, | ||
tabbableOptions: PropTypes.shape({ | ||
displayCheck: PropTypes.oneOf(['full', 'non-zero-area', 'none']), | ||
getShadowRoot: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), | ||
}), | ||
}), | ||
@@ -316,0 +320,0 @@ containerElements: PropTypes.arrayOf(PropTypes.instanceOf(ElementType)), |
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
61190
590
236
Updatedfocus-trap@^6.8.1