diff --git a/CHANGELOG.md b/CHANGELOG.md index a3dbe424a..63bf14b5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Bump `stripes-react-hotkeys` to `v3.2.0` for compatibility with `findDOMNode()` changes. STCOM-1343. * Pin `currency-codes` to `v2.1.0` to avoid duplicate entries in `v2.2.0`. Refs STCOM-1379. * Wrap `` in full-width div. Refs STCOM-1332. +* Assign ``'s exit key handler to Modal's element rather than `document`. refs STCOM-1382. ## [12.2.0](https://github.com/folio-org/stripes-components/tree/v12.2.0) (2024-10-11) [Full Changelog](https://github.com/folio-org/stripes-components/compare/v12.1.0...v12.2.0) diff --git a/lib/Modal/WrappingElement.js b/lib/Modal/WrappingElement.js index a9b436b99..535e9e9e1 100644 --- a/lib/Modal/WrappingElement.js +++ b/lib/Modal/WrappingElement.js @@ -123,7 +123,7 @@ const WrappingElement = forwardRef(({ focusTrapRef.current.activate(); ATTrap.apply(); } - keyDownHandlerRef.current = listen(document, 'keydown', keyDownHandler); + keyDownHandlerRef.current = listen(modalElementRef.current, 'keydown', keyDownHandler); focusHandlerRef.current = listen(document, 'focus', enforceFocusTimeout, true); onOpen(); }