diff --git a/.changeset/mean-bees-ring.md b/.changeset/mean-bees-ring.md new file mode 100644 index 00000000000..965a8d3d3d1 --- /dev/null +++ b/.changeset/mean-bees-ring.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +useMnemonics hook ignores keydown events from textarea elements diff --git a/src/__tests__/hooks/useMnemonics.test.tsx b/src/__tests__/hooks/useMnemonics.test.tsx index 5bbb9e58b38..90ebb09c2d8 100644 --- a/src/__tests__/hooks/useMnemonics.test.tsx +++ b/src/__tests__/hooks/useMnemonics.test.tsx @@ -5,10 +5,12 @@ import {useMnemonics} from '../../hooks' const Fixture = ({ onSelect = () => null, hasInput = false, + hasTextarea = false, refNotAttached = false }: { onSelect?: (event: React.KeyboardEvent) => void hasInput?: boolean + hasTextarea?: boolean refNotAttached?: boolean }) => { const containerRef = React.createRef() @@ -19,6 +21,8 @@ const Fixture = ({
{/* eslint-disable-next-line jsx-a11y/no-autofocus */} {hasInput && } + {/* eslint-disable-next-line jsx-a11y/no-autofocus */} + {hasTextarea &&