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

Button ripples too often on keydown in chrome 49 #16366

Closed
1 of 2 tasks
eps1lon opened this issue Jun 25, 2019 · 8 comments
Closed
1 of 2 tasks

Button ripples too often on keydown in chrome 49 #16366

eps1lon opened this issue Jun 25, 2019 · 8 comments
Labels
component: ButtonBase The React component. external dependency Blocked by external dependency, we can’t do anything about it

Comments

@eps1lon
Copy link
Member

eps1lon commented Jun 25, 2019

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

When a Button is focused a repeating keydown those not restart the ripple
button-ripple-repeat

Current Behavior 😯

Ripple restarts on every keydown fired
button-ripple-repeat-bad

Steps to Reproduce 🕹

Link: https://material-ui.com/components/buttons/#contained-buttons

  1. Tab till first "Default" button is focus visible
  2. hold down space

Your Environment 🌎

Tech Version
Material-UI v4.1.2
React 16.8.6
Browser Crhome Version 49.0.2623.75 (64-bit)
@eps1lon eps1lon added bug 🐛 Something doesn't work component: ButtonBase The React component. labels Jun 25, 2019
@eps1lon eps1lon mentioned this issue Jun 25, 2019
1 task
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 25, 2019

This behavior seems to be reproducible cross-browsers on Windows (even with Firefox and Chrome latest). I can't reproduce it on macOS.

I'm wondering, do we even need this animation? Why does it only trigger on Space and not Enter? What about removing it?

@eps1lon
Copy link
Member Author

eps1lon commented Jun 25, 2019

I'm wondering, do we even need this animation?

Visual feedback.

Why does it only trigger on Space and not Enter?

The current behavior matches native buttons.

What about removing it?

See first point.

@eps1lon
Copy link
Member Author

eps1lon commented Jun 25, 2019

To summarize:
On native buttons:

  • Enter keydown clicks
  • Space keydown applies :active
  • Space keyup clicks

The ripple is our :active styling but the restart of the ripple is quite heavy which is why the code wants to prevent this. This is not working on chrome 49.

This behavior seems to be reproducible cross-browsers on Windows (even with Firefox and Chrome latest). I can't reproduce it on macOS.

I guess macOS is your actual OS while windows is run in browserstack? Because in browserstack I have issues in chrome 75 as well but not if I run it on my actual OS.

Maybe it's just a browserstack issue where it sends keydown-up-down-up instead of keydown-down-up.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 25, 2019

I guess macOS is your actual OS while windows is run in browserstack?

@eps1lon Correct. My real OS is macOS, yours is Linux, Josh is Windows. Great complementarity! Let's ask for help :)

@joshwooding Could you try what's the behavior on Windows? We don't have access to a real environment. It would help, thanks!

@eps1lon
Copy link
Member Author

eps1lon commented Jun 25, 2019

Could you try what's the behavior on Windows? We don't have access to a real environment.

I have a dual boot setup for that purpose. It works on win and linux. I'm wondering why the other tests passed though. Probably timing related.

@oliviertassinari
Copy link
Member

Oh nice!

@eps1lon
Copy link
Member Author

eps1lon commented Jun 25, 2019

Pretty sure this is just a browser stack issue. It seems like the events work fine if coming from inside the browser. The failure was caused by a missing event.key in chrome 49. Basically same issue but different cause: One browserstack the other old browsers.

@eps1lon
Copy link
Member Author

eps1lon commented Jun 25, 2019

Same browser, same OS: only browserstack has the issue

@eps1lon eps1lon closed this as completed Jun 25, 2019
@eps1lon eps1lon added external dependency Blocked by external dependency, we can’t do anything about it and removed bug 🐛 Something doesn't work labels Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ButtonBase The React component. external dependency Blocked by external dependency, we can’t do anything about it
Projects
None yet
Development

No branches or pull requests

2 participants