Skip to content

Commit

Permalink
fix: Restore negative margin in splitbutton
Browse files Browse the repository at this point in the history
  • Loading branch information
d-beezee committed Oct 9, 2024
1 parent a40b832 commit 8db7903
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/stories/buttons/split-button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { SplitButton as ZendeskSplitButton } from "@zendeskgarden/react-buttons";
import { forwardRef } from "react";
import styled from "styled-components";
import { SplitButtonArgs } from "./_types";

const SplitButtonWrapper = styled.div`
[data-garden-id="buttons.button"] {
margin-right: -1px;
}
`;

/**
A Split button is a hybrid between a Dropdown Menu and a Button. It lets users choose from parallel actions and take action on their choice.
<hr>
Expand All @@ -10,7 +17,11 @@ Used for this:
- To reduce visual complexity when there are multiple actions a user can take
**/
const SplitButton = forwardRef<HTMLDivElement, SplitButtonArgs>(
(props, ref) => <ZendeskSplitButton ref={ref} {...props} />
(props, ref) => (
<SplitButtonWrapper>
<ZendeskSplitButton ref={ref} {...props} />
</SplitButtonWrapper>
)
);

export { SplitButton };

0 comments on commit 8db7903

Please sign in to comment.