material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.26k stars 3.06k forks source link

[Chip] Chip's close button works too wide #4022

Open mr-bogey opened 7 months ago

mr-bogey commented 7 months ago

Why does the trigger area of the close button occupy textEndPadding? If the text of my Clip is a single text, then the clickable range of the Clip is only a little bit on the text side, even if I widen the textPadding, it will not work. Snipaste_2024-01-31_11-52-57

pekingme commented 6 months ago

Do you have a screenshot of your chip? IIUC, the label is only a single character. When you try to select the chip, the close icon was triggered accidentally, right? I believe we were trying to maximize the min touch target of the close icon, since it's already very small.

mr-bogey commented 6 months ago

PixPin_2024-03-08_12-24-32

mr-bogey commented 6 months ago

Do you have a screenshot of your chip? IIUC, the label is only a single character. When you try to select the chip, the close icon was triggered accidentally, right? I believe we were trying to maximize the min touch target of the close icon, since it's already very small.

Yes. But the close button is big enough that a wider trigger range is no longer needed

mr-bogey commented 6 months ago

In addition, textEndPadding adds a trigger area to the close button instead of adding a trigger area to the text. Normally, this should be difficult to understand.

pekingme commented 6 months ago

Make sense. I think we can solve this by caping the width of the touch bound of the close icon. So that when you increase the textEndPadding, not all of it will contribute to that touch bound. Will also consult our A11y team.