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

[SpeedDial] SpeedDialAction onClick not working when you click the touch screen #13006

Closed
knight3001 opened this issue Sep 26, 2018 · 8 comments · Fixed by #17301
Closed

[SpeedDial] SpeedDialAction onClick not working when you click the touch screen #13006

knight3001 opened this issue Sep 26, 2018 · 8 comments · Fixed by #17301
Assignees
Labels
component: speed dial This is the name of the generic UI component, not the React module!

Comments

@knight3001
Copy link

  • [ ✔] 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

SpeedDialAction onClick should trigger when click the actions. 

Current Behavior

For the laptop with touch screen, it works fine for touch event, but not works when you get a mouse and click it.

Steps to Reproduce

Just run the example https://material-ui.com/lab/speed-dial/ on touch screen with the mouse click.

Link:

Context

Your Environment

Tech Version
Material-UI v3.1.1
React v16.4.2
Browser Chrome v69
material-ui/lab 3.0.0-alpha.17
@knight3001 knight3001 changed the title [SpeedDial] SpeedDialAction onClick not working when you [SpeedDial] SpeedDialAction onClick not working when you click the touch screen Sep 26, 2018
@oliviertassinari oliviertassinari added the component: speed dial This is the name of the generic UI component, not the React module! label Sep 26, 2018
@JBBx2016
Copy link

JBBx2016 commented Oct 11, 2018

Hi - I have looked into this particular case, and it appears that the onClick parameter is not passed along to Button component in SpeedDialAction if device is touch capable.

This was introduced by the following commit: 3db734f

Below is a screenshot from the commit showing that onClick is not passed to Button:
image

At least clickProps should also contain onMouseDown: onClick.

@ulrichSchreiner
Copy link

hi,

would be great to get a fix for this. with this implementation our surface-book cannot click anymore on the button. you have to touch it.

a little strange for the users ...

@seanchambo
Copy link
Contributor

Are we able to get a fix for this?

@Ameobea
Copy link

Ameobea commented Mar 6, 2019

We're still seeing this issue. I've had to set up custom behavior (showing the content on hover rather than on click) if that document.documentElement.ontouchstart prop exists) in order to work around this for some users.

@zwise
Copy link

zwise commented Mar 7, 2019

Has anyone seen newer Macbooks experiencing this issue in Chrome due to the Touchbar?

@Ameobea
Copy link

Ameobea commented Mar 7, 2019

No; I use a macbook with the touchbar at work, but the issue doesn't happen for me. I think it's due to the fact that my document.documentElement doesn't have the ontouchstart attribute.

@michaelplazek
Copy link

I'm seeing the same behavior is is described above. The event isn't being passed to the button on touch capable devices. Its coming up as undefined.

@JapuDCret
Copy link
Contributor

JapuDCret commented May 22, 2019

one fix for me was passing the onClick via the ButtonProps see SpeedDialAction.js#L133

<SpeedDialAction
	key={'do-something'}
	icon={<EditIcon />}
	tooltipTitle={'Do something'}
	tooltipOpen
	// onClick={(e) => this.doAction(e)}
	ButtonProps={{
		onClick: (e) => this.doAction(e)
	}}
	/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: speed dial This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants