Skip to content

[joy-ui][Button] Broken styles with custom button elements that return null #40021

Open
@phillip-winder

Description

@phillip-winder

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

https://codesandbox.io/p/sandbox/friendly-jennings-cmj2zw?file=%2FDemo.tsx

  1. Create custom Button that conditionally returns null:
const A = (props) => {
  if (props.null)
    return null;
  return <Button {...props}>hi</Button>;
};
  1. Use Button in ButtonGroup:
<ButtonGroup>
  <A/>
  <A/>
  <A null/>
</ButtonGroup>

Current behavior 😯

The borders of the ButtonGroup are not rounded.

Expected behavior 🤔

The borders of the ButtonGroup should be rounded.

Context 🔦

Might be related to #39372

Your environment 🌎

@mui/joy 5.0.0-beta.15

Metadata

Metadata

Assignees

Labels

bug 🐛Something doesn't workcomponent: ButtonGroupThe React component.component: buttonThis is the name of the generic UI component, not the React module!package: joy-uiSpecific to @mui/joy

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions