-
Notifications
You must be signed in to change notification settings - Fork 45
Added SplitButton teams component #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
SplitButtonPropsBase, | ||
'size' | 'disabled' | 'disabledFocusable' | ||
> { | ||
appearance?: 'transparent' | 'primary'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could extend from ButtonProps
* SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary | ||
* action, while interacting with the second one opens a menu with secondary actions. | ||
*/ | ||
export const SplitButton = React.forwardRef< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SplitButton in Fluent is a bit of a weird component since it really doesn't like JSX children. Wondering if we want to consider an children based API for the teams version of this
<SplitButton>
<SplitButtonMain />
<SplitButtonMenu />
</SplitButton>
packages/teams-components/src/components/ToggleButton/renderTooltip.tsx
Outdated
Show resolved
Hide resolved
return ( | ||
<div className={styles.sampleContainer}> | ||
<Menu positioning="below-end"> | ||
<SplitButton>Split</SplitButton> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it accessible to create a split button without a title/aria-label for the menu button part?
|
||
it('should throw error if menuTitle is provided without main title', () => { | ||
expect(() => | ||
render(<SplitButton menuTitle="Menu">Test</SplitButton>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this requirement, why would menu title make the title required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If title is provided without menu title, tooltip will be applied to the full SplitButton
If both are given, there will be separate tooltip for action button and menu button - so I think it makes no sense to be able to provide only menu title
This PR adds the SplitButton component to the Teams component library: