mui / mui/material-ui

[ButtonGroup][Joy] Borders don't work properly with non-matching variants

Open
#37,809 1 comment 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Jul 4, 2023.

component: ButtonGroup package: joy-ui scope: button type: enhancement
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/admiring-james-kzmpdk?file=/demo.tsx

Steps:

  1. Create a button group
  2. Make a button deviate from the button group's variant and/or color
Current behavior 😯

Using the default props of the button group, the button group will try to apply a border to the button in the groups color, rather than adhering to the styling of the button itself.

The inverse happens when applying a different variant to the button group and adding a outlined button within it, which basically recreates #37574.

image

The buttons seem to rely on the button group styling where they shouldn't.

Expected behavior 🤔

The button defines the styles and color applied to it if they are set, and otherwise use the color and/or variant from the button group.

Context 🔦

Trying to make a button group with spacing where the primary action has a highlighted style.

Your environment 🌎

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.