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

[Select] Feels less response than native counterpart #8999

Closed
1 task done
rynti opened this issue Nov 5, 2017 · 7 comments · Fixed by #17978
Closed
1 task done

[Select] Feels less response than native counterpart #8999

rynti opened this issue Nov 5, 2017 · 7 comments · Fixed by #17978
Labels
component: select This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@rynti
Copy link

rynti commented Nov 5, 2017

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

Expected Behavior

When I use a Select Field, it should "feel" responsive and fast. Currently, before the menu with all select options pops up, we wait until the mouseclick is over. Instead, at least on non-touch devices we should consider starting the opening animation as soon as the click starts (for instance the mousedown event).

Current Behavior

As described in "Expected Behavior", currently we wait until the click event is over before the Select field opens the menu with all options. This makes it feel much less responsive and slow compared with say the native select field in Chrome, which opens instantly.

Steps to Reproduce

Check the Select page in the current documentation to try it out: https://material-ui.com/demos/selects/

Context

We use the select field in various places of our app, and we feel like the current behavior of the Select field makes our application feel sluggish and slow.

Your Environment

Tech Version
Material-UI Beta 20
React 15.6.2
browser Google Chrome 61.0.3163.100
@oliviertassinari oliviertassinari added the component: select This is the name of the generic UI component, not the React module! label Nov 5, 2017
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 5, 2017

One important thing to take into account: the behavior should stay the same for touch interactions as we need to filter our scroll touch interactions.

@oliviertassinari oliviertassinari added performance good first issue Great for first contributions. Enable to learn the contribution process. labels Nov 5, 2017
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 5, 2017

I hope it's as simple as implemented as replacing the onClick by onMouseDown event callback.
https://github.com/callemall/material-ui/blob/7064086473f255bd48fcfc2987b0353a8c7c7b7c/src/Select/SelectInput.js#L347

@rynti
Copy link
Author

rynti commented Nov 6, 2017

I tried your solution and it turns out it works just fine by adding an equivalent onMouseDown handler. Tested on desktop (Google Chrome) and mobile (Android Phone).

@oliviertassinari oliviertassinari removed the good first issue Great for first contributions. Enable to learn the contribution process. label Nov 6, 2017
@oliviertassinari oliviertassinari added this to the post v1 milestone Feb 11, 2018
@oliviertassinari oliviertassinari removed this from the post v1.0.0 milestone Jul 17, 2018
@oliviertassinari oliviertassinari added the good first issue Great for first contributions. Enable to learn the contribution process. label Jul 22, 2018
@oliviertassinari
Copy link
Member

@rynti Do you want to submit a pull request?

@adeelibr
Copy link
Contributor

if onMouseDown handler doesn't work, is there a possibility where we can have both, onClick & on onMouseDown handler.

Where as you say #9009 (comment)

I'm sorry, this is definitely not a simple issue to fix. It's surfacing another issue with how the focus is handled. It's will require a rethink of how it's done. It's certainly not a one-line change.

where onClick. can manage how the focus is handled and onMouseDown event calls

https://github.com/mui-org/material-ui/blob/7064086473f255bd48fcfc2987b0353a8c7c7b7c/src/Select/SelectInput.js#L347

@oliviertassinari

@jmetev1
Copy link
Contributor

jmetev1 commented Nov 13, 2018

I worked on this for a while, but then I thought I would check on the actual premise of the idea, that using onmousedown over onclick would make things any faster, and it sure doesn't seem like it based on my testing and research. I would say maybe close this so nobody else wastes times trying to implement it. @oliviertassinari

@oliviertassinari
Copy link
Member

@jmetev1 I have been benchmarking (testing) as many platforms as possible, they all close the select and menu at the mouse down event rather than the mouse up event. I think that it's a good reason on its own to try to follow this convention.

@joshwooding joshwooding added the hacktoberfest https://hacktoberfest.digitalocean.com/ label Sep 30, 2019
@oliviertassinari oliviertassinari added component: select This is the name of the generic UI component, not the React module! new feature New feature or request and removed component: select This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. hacktoberfest https://hacktoberfest.digitalocean.com/ performance labels Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants