[ButtonGroup] Breaking when adding href to Button
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
When using MUI’s ButtonGroup, as soon as we add an href to one of the buttons, it breaks the layout, like so:
<ButtonGroup variant="contained" aria-label="outlined primary button group">
<Button href="test.com">One</Button>
<Button>Two</Button>
<Button>Three</Button>
</ButtonGroup>
Result:
Expected behavior 🤔
Steps to reproduce 🕹
Steps:
- Using MUI’s ButtonGroup, like so:
<ButtonGroup variant="contained" aria-label="outlined primary button group">
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</ButtonGroup>
- Adding href to one of the buttons
Context 🔦
No response
Your environment 🌎
Using BraveBrowser Version 1.35.104 Chromium: 98.0.4758.109 (Build officiel) (x86_64)
`npx @mui/envinfo`
System:
OS: macOS 12.2.1
Binaries:
Node: 17.5.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 98.0.4758.109
Edge: Not Found
Firefox: Not Found
Safari: 15.3
npmPackages:
@emotion/react: ^11.8.1 => 11.8.1
@emotion/styled: ^11.8.1 => 11.8.1
@mui/base: 5.0.0-alpha.69
@mui/icons-material: ^5.4.2 => 5.4.2
@mui/material: ^5.4.3 => 5.4.3
@mui/private-theming: 5.4.2
@mui/styled-engine: 5.4.2
@mui/styles: ^5.4.2 => 5.4.2
@mui/system: 5.4.3
@mui/types: 7.1.2
@mui/utils: 5.4.2
@types/react: 17.0.39
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Material UI ButtonGroup breaks when adding href to Button
Here is the CodeSandbox with reproduction ! When using MUI's ButtonGroup, the layout is fine with three "regular" buttons: <ButtonGroup variant= ...
Read more >Button group - Bootstrap
Group a series of buttons together on a single line with the button group, and super-power them with JavaScript.
Read more >Adding a Link to a Bootstrap Button with React Router
While working on my React based portfolio website recently, I ran into an issue regarding buttons and links. I had designed a section...
Read more >Selection and Nesting in JavaScript ButtonGroup control
ButtonGroup supports radio type selection in which only one button can be selected. This can be achieved by adding input element along with...
Read more >Create radio button component - MATLAB uiradiobutton
Subsequent buttons added to the same button group have a default state of 0 . When the Value property of a RadioButton changes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, are there any updates on this? This issue stops me from upgrading to v5. v4 doesn’t have such an issue.
https://github.com/mui/material-ui/issues/29514 should fix this issue