Skip to content

[ButtonGroup] Sticky hover leaves a darkened divider border after tapping on touch devices #48992

Description

@petr-kratochvil

Steps to reproduce

Steps:

  1. Open this link to live example
  1. Open it on touch device. Firefox's Responsive Design Mode also serves good. Chrome's DevTools don't emulate the touch effect fully enough.
  2. Tap the first or the middle button in any ButtonGroup.

Current behavior

The right (or bottom) border of the tapped button is darkened and stays like that until blur.

Screenshots from Firefox 153 (Macos, in Responsive Design Mode):

Image Image

Expected behavior

The right (or bottom) border of the tapped button should not be pernamently changed on tap. The behavior should be consistent with the behavior of the Button component outside a ButtonGroup.

Context

  • A ButtonGroup with variant="oulined" and at least two buttons
  • The tap on touch device triggers :hover class, and leaves the style sticky
  • The :hover class for a button in a ButtonGroup is not consistent on @media not (hover: hover) - it highlights only the right border of the first or middle button.

Your environment

npx @mui/envinfo
  System:
    OS: macOS 15.7.7
  Binaries:
    Node: 24.19.0 - /usr/local/bin/node
    npm: 11.17.0 - /usr/local/bin/npm
    pnpm: 11.21.0 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 151.0.7922.138
    Edge: Not Found
    Firefox: 153.0.3
    Safari: 26.5
  npmPackages:
    @mui/internal-babel-plugin-minify-errors: 2.0.8-canary.27 => 2.0.8-canary.27 
    @mui/internal-bundle-size-checker: 1.0.9-canary.78 => 1.0.9-canary.78 
    @mui/internal-code-infra: 0.0.4-canary.101 => 0.0.4-canary.101 
    @mui/internal-netlify-cache: 0.0.3-canary.5 => 0.0.3-canary.5 
    @mui/internal-scripts: workspace:^ => 3.0.10 
    @mui/internal-test-utils: 2.0.18-canary.23 => 2.0.18-canary.23 
    @pigment-css/react: 0.0.31 => 0.0.31 
    @types/react: 19.2.18 => 19.2.18 
    react: 19.2.8 => 19.2.8 
    react-dom: 19.2.8 => 19.2.8 
    typescript: 6.0.3 => 6.0.3 

Touch behavior tested on Chrome 151 (on Android) and in Firefox 153 (Macos, in Responsive Design Mode).

Search keywords: ButtonGroup hover outlined border touch

Metadata

Metadata

Assignees

Labels

component: ButtonGroupThe React component.ready to takeHelp wanted. Guidance available. There is a high chance the change will be acceptedtype: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions