Skip to content

Commit

Permalink
Fix primefaces#5367: SpeedDial close on escape
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jan 9, 2024
1 parent 716c1f0 commit d67b263
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/lib/speeddial/SpeedDial.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { PrimeReactContext } from '../api/Api';
import { Button } from '../button/Button';
import { useHandleStyle } from '../componentbase/ComponentBase';
import { useEventListener, useMountEffect, useUpdateEffect } from '../hooks/Hooks';
import { useEventListener, useMountEffect, useOnEscapeKey, useUpdateEffect } from '../hooks/Hooks';
import { MinusIcon } from '../icons/minus';
import { PlusIcon } from '../icons/plus';
import { Ripple } from '../ripple/Ripple';
Expand All @@ -27,6 +27,7 @@ export const SpeedDial = React.memo(
const { ptm, cx, sx, isUnstyled } = SpeedDialBase.setMetaData(metaData);

useHandleStyle(SpeedDialBase.css.styles, isUnstyled, { name: 'speeddial' });
useOnEscapeKey(elementRef, visible, () => hide());
const isItemClicked = React.useRef(false);
const elementRef = React.useRef(null);
const listRef = React.useRef(null);
Expand Down

0 comments on commit d67b263

Please sign in to comment.