Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chip] Clickable area expands with line-height #45097

Open
DiegoAndai opened this issue Jan 23, 2025 · 2 comments · May be fixed by #45101
Open

[Chip] Clickable area expands with line-height #45097

DiegoAndai opened this issue Jan 23, 2025 · 2 comments · May be fixed by #45101
Labels
bug 🐛 Something doesn't work component: chip This is the name of the generic UI component, not the React module! ready to take Help wanted. Guidance available. There is a high chance the change will be accepted

Comments

@DiegoAndai
Copy link
Member

DiegoAndai commented Jan 23, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/react-ryuspuxm?file=Demo.tsx
  2. Click anywhere inside the black border box

Current behavior

The chip is clicked even though the pointer is outside the Chip.

Expected behavior

The chip should only be clicked when the pointer is inside the Chip.

Context

Found in mui/mui-x#16304

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.5
  Binaries:
    Node: 22.2.0 - ~/.nvm/versions/node/v22.2.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v22.2.0/bin/npm
    pnpm: 9.15.4 - ~/.nvm/versions/node/v22.2.0/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.265
    Edge: 132.0.2957.115
    Safari: 17.5
  npmPackages:
    @mui/material: 6.4.1

Search keywords: Chip line-height

@DiegoAndai DiegoAndai added bug 🐛 Something doesn't work component: chip This is the name of the generic UI component, not the React module! labels Jan 23, 2025
@DiegoAndai
Copy link
Member Author

I think this should be considered a bug; what do you think, @aarongarciah?

@aarongarciah
Copy link
Member

@DiegoAndai yes. Looks like the .MuiChip-label element should have an explicit line-height to avoid inheritance.

@DiegoAndai DiegoAndai added the ready to take Help wanted. Guidance available. There is a high chance the change will be accepted label Jan 23, 2025
@MachaVivek MachaVivek linked a pull request Jan 23, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: chip This is the name of the generic UI component, not the React module! ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants