Skip to content

Commit

Permalink
feat(SplitButton): add flip prop support
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang committed Jun 24, 2022
1 parent 85ef5bc commit 909c564
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/SplitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface SplitButtonProps
title: React.ReactNode;
toggleLabel?: string;
type?: ButtonType;
flip?: boolean;
}

const propTypes = {
Expand Down Expand Up @@ -74,6 +75,13 @@ const propTypes = {
*/
rootCloseEvent: PropTypes.string,

/**
* Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
* Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
*
*/
flip: PropTypes.bool,

/** @ignore */
bsPrefix: PropTypes.string,
/** @ignore */
Expand Down Expand Up @@ -114,6 +122,7 @@ const SplitButton = React.forwardRef<HTMLElement, SplitButtonProps>(
menuRole,
renderMenuOnMount,
rootCloseEvent,
flip,
...props
},
ref,
Expand Down Expand Up @@ -146,6 +155,7 @@ const SplitButton = React.forwardRef<HTMLElement, SplitButtonProps>(
role={menuRole}
renderOnMount={renderMenuOnMount}
rootCloseEvent={rootCloseEvent}
flip={flip}
>
{children}
</Dropdown.Menu>
Expand Down

0 comments on commit 909c564

Please sign in to comment.