Skip to content

Commit

Permalink
assign modal escape key handler to modal element rather than document (
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnC-80 authored Nov 13, 2024
1 parent 14df458 commit 2f43c1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<Selection>` in full-width div. Refs STCOM-1332.
* Assign `<Modal>`'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)
Expand Down
2 changes: 1 addition & 1 deletion lib/Modal/WrappingElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 2f43c1c

Please sign in to comment.