material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[ListItem] rightIconButton doesn't prevent ripple on mobile

Open EloB opened this issue 10 years ago • 15 comments

It works in desktop without the ripple.

Here is an example:

  • Visit https://mtg.zone (site only works on chrome and safari because I use websql)
  • Make your screen small so you see the icon on the top right menu
  • Add a card to deck
  • Click on the top right icon
  • Tap (with a touch event) on the zoom button to trigger the ripple

Touch tap ripple

Mouse click no-ripple

EloB avatar Mar 02 '16 08:03 EloB

Hi @EloB I tried to reproduce this in desktop using step you described but for me it's working perfectly fine. I'm using Chrome (Version: 48.0.2564.116) I've also checked in Safari(Version: 9.0.3) working fine there too.

Here's the Mouse Click example:

Alt Text

heetvachhani avatar Mar 02 '16 15:03 heetvachhani

@heetvachhani What happens when you use chrome dev tools to simulate a touch?

That reproduces it for me:

image

nathanmarks avatar Mar 02 '16 15:03 nathanmarks

Yes that reproduced for me :grin:

heetvachhani avatar Mar 02 '16 16:03 heetvachhani

@EloB : I'm trying to fix this and was trying to reproduce it. So I wanted to understand the structure of the list that you are using.

Can you shed some light on this. Check this page from our docs site and see if you find issue with the nested lists.

tintin1343 avatar Mar 02 '16 21:03 tintin1343

@EloB : So, I tried reproducing the issue you are having on the docs page and I was able to do it on the nested list example which looks similar to your use case.

I noticed the nested list-item did not let the touch ripple bubble up to the list-item parent. However the parent list-item labelled "inbox" behaved in the same way as your use-case.

touch-issue

I added the prop disabled={true} to the parent list-item labelled "inbox" and that solved the problem. The ripple can be seen on touch only but not on click of the list-item since its disabled. I bet the problem with your use-case is similar.

touch-solved

Let me know, if this solves the problem.

@nathanmarks : Is this an bug in our docs page? I see it as more of a use-case thing.

tintin1343 avatar Mar 02 '16 21:03 tintin1343

Im getting the bug on the docs as well.

ripple

EloB avatar Mar 02 '16 21:03 EloB

I need to be able to click the list and also the rightButtonElement. So disable it will only make the rightButtonElement to work right?

EloB avatar Mar 02 '16 21:03 EloB

I think the way ListItem triggers the ripples are kind of broken. On a phone it triggers the ripples everytime you touch them. Very annoying when you scroll the page. Maybe this is another bug. Should I make another issue with that? Try this on a phone and scroll down the page: https://mtg.zone/#/sets

EloB avatar Mar 02 '16 21:03 EloB

@EloB : Yes. I did enable touch on devtools. Thank you for explaining your use-case. Yes you are right. The list-item won't be clickable but the icon will be. I misunderstood from your screengrab. Now that I know what you are trying to achieve, let me try and see if it is fixable.

Also, i checked your website on phone. The list-item, is not clickable when I tried it through my phone. only the right-icon is clickable.

tintin1343 avatar Mar 02 '16 21:03 tintin1343

By clicking on the ListItem it should decrease the left avatar number by one.

EloB avatar Mar 02 '16 21:03 EloB

The clicking the ListItem it should decrease the left avatar number by one.

Doesn't work in mobile chrome browser. It closes the side nav when I click on the list-item. Anyway, Let me see what I can do.

tintin1343 avatar Mar 02 '16 21:03 tintin1343

Oh that's because its the last item if you have more than one card in the deck. Then you will see that is decreases.

EloB avatar Mar 03 '16 08:03 EloB

@EloB : Yeah I did see that. Thanks!

tintin1343 avatar Mar 03 '16 21:03 tintin1343

Thanks for solving this issue! :+1:

EloB avatar Mar 04 '16 01:03 EloB

@Elob : No worries man. Happy to help! Best of luck with your project.

tintin1343 avatar Mar 04 '16 01:03 tintin1343