Skip to content

Commit

Permalink
fix: #5365, SplitButton: SplitButton popup not closing on escape butt…
Browse files Browse the repository at this point in the history
…on click (#5366)

* fix: #5365, SplitButton: SplitButton popup not closing on escape button click

* fix: #5365, SplitButton: SplitButton popup not closing on escape button click

* fix: #5365, SplitButton: SplitButton popup not closing on escape button click

---------

Co-authored-by: akshayantony55 <[email protected]>
  • Loading branch information
akshayaqburst and akshayantony55 authored Nov 22, 2023
1 parent ea60018 commit c87d4fa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/lib/splitbutton/SplitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { DomHandler, IconUtils, ObjectUtils, UniqueComponentId, ZIndexUtils, cla
import { SplitButtonBase } from './SplitButtonBase';
import { SplitButtonItem } from './SplitButtonItem';
import { SplitButtonPanel } from './SplitButtonPanel';
import { useOnEscapeKey } from '../../lib/hooks/Hooks';

export const SplitButton = React.memo(
React.forwardRef((inProps, ref) => {
Expand All @@ -32,6 +33,7 @@ export const SplitButton = React.memo(
const { ptm, cx, isUnstyled } = SplitButtonBase.setMetaData(metaData);

useHandleStyle(SplitButtonBase.css.styles, isUnstyled, { name: 'splitbutton' });
useOnEscapeKey(overlayRef, overlayVisibleState, () => hide());

const [bindOverlayListener, unbindOverlayListener] = useOverlayListener({
target: elementRef,
Expand Down

0 comments on commit c87d4fa

Please sign in to comment.