mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.23k stars 1.86k forks source link

Button.Group does not group buttons correctly when using mixed polymorphic buttons #4182

Closed jvllmr closed 1 year ago

jvllmr commented 1 year ago

What package has an issue

@mantine/core

Describe the bug

Buttons in ButtonGroup don't group together when using Button with different components, e.g. button, a, React-Router Link.

What version of @mantine/hooks page do you have in package.json?

6.0.10

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/amazing-flower-dmm1nl?file=%2Fsrc%2FApp.tsx

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

Use :first-child selector and :last-child selector instead of :first-of-type and :last-of-type in ButtonGroup styles. Bad side effect would be that other non-button elements in ButtonGroup can have an effect on the button grouping.

rtivital commented 1 year ago

The issue was fixed in 7.0