material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[Chip] Chip's close button works too wide

Open mr-bogey opened this issue 1 year ago • 5 comments
trafficstars

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

mr-bogey avatar Jan 31 '24 04:01 mr-bogey

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.

pekingme avatar Mar 07 '24 23:03 pekingme

PixPin_2024-03-08_12-24-32

mr-bogey avatar Mar 08 '24 04:03 mr-bogey

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 avatar Mar 08 '24 04:03 mr-bogey

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.

mr-bogey avatar Mar 08 '24 05:03 mr-bogey

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.

pekingme avatar Mar 08 '24 17:03 pekingme