mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.91k stars 32.27k forks source link

[ButtonGroup] Split Button with href does not style correctly #33259

Closed JLaferri closed 2 years ago

JLaferri commented 2 years ago

Duplicates

Latest version

Current behavior 😯

image

Expected behavior 🤔

image

Steps to reproduce 🕹

Steps:

  1. Try the following code. With an href, you get the incorrect styling, without the href, you get the correct styling
    <ButtonGroup aria-label="split button">
    <Button href='test.com' style={{ flex: 1 }}>
    Test
    </Button>
    <Button>
    <ArrowDropDown />
    </Button>
    </ButtonGroup>

Context 🔦

This functionality used to work in v4 but seems to maybe be broken in v5. I'm open to workarounds in the meantime if anyone has any ideas.

Your environment 🌎

I can't get this to run. It returns with the output: '"C:\Users\Jas\AppData\Local\Yarn\bin\\..\Data\global\node_modules\.bin\envinfo.cmd"' is not recognized as an internal or external command, operable program or batch file.

Any advice?

mnajdova commented 2 years ago

It doesn't look like this bug report has enough info for one of us to reproduce it.

Please provide a CodeSandbox (https://material-ui.com/r/issue-template-latest), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.

Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

Codesandbox I tried: https://codesandbox.io/s/flamboyant-sun-qml7h0?file=/src/App.tsx

PunitSoniME commented 2 years ago

@JLaferri

The result you want to achieve is pretty much simple. Check below sandbox code and let me know if you have any confusion.

And also I have fixed your link redirection as well on click of the button

Codesandbox

github-actions[bot] commented 2 years ago

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.