-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Fix SpeedDials pressed twice on mobile #10713
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlbertLucianto Thanks for looking into it. The fix looks good to me, but I will let @oliviertassinari have the final say.
@mbrookes I don't want to focus on extra components before the release of stable v1. I trust you with this. I won't review it; |
@AlbertLucianto Thanks! |
@AlbertLucianto Unfortunately this may be problematic for hybrid touch / mouse devices (Surface Pro etc.) Could you take another look? I won't revert this just yet. |
@mbrookes You're correct, I haven't considered such cases. Let me try work a little bit more about that. If you have any suggestion, I'd be very happy to know! |
@AlbertLucianto neither had I - @oliviertassinari pointed it out. (Just wish it was before I merged this 😄). It's a tricky one for sure. |
@mbrookes Actually, one solution could be by adding handleTouch = e => {
e.stopPropagation();
this.handleClick();
}; So that the default mouse-emulation handling doesn’t occur. However, it still does not work correctly. One cause may be related to this issue in React about |
Sorry for the long silence, I didn't notice the PR being referenced to my issue. I'll be sure to verify and test as soon as I get some spare time! |
This is a possible fix for issue #10684
Description
Currently in docs, the tapping on
SpeedDial
button will triggeronMouseEnter
andonFocus
in mobile before callingonClick
, i.e. theopen
state transitions fromfalse (initial state) > true (onMouseEnter) > true (onFocus) > false (onClick toggle)
Solution
Need to know whether page is opened in touch screen. It can be checked through
and set the
SpeedDial
propsReally appreciate for a review!