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

Cannot select menu items on mobile #1036

Closed
vitaminwater opened this issue Jun 18, 2016 · 23 comments
Closed

Cannot select menu items on mobile #1036

vitaminwater opened this issue Jun 18, 2016 · 23 comments

Comments

@vitaminwater
Copy link

I got on a bug preventing me from selecting any menu items on mobile only.
Turns out, selecting an item would trigger handleInputFocus with Select-input as target.

Removing the call to renderInput for non-searchable select fixed it.

@Moeface
Copy link

Moeface commented Jun 20, 2016

Also having this same issue, though only on iOS devices - both Chrome and Safari. Works fine on Android phones.

@adamthewan
Copy link

Same bug here. Have to hold the item on mobile for it to work, pretty annoying!

@adamthewan
Copy link

@vitaminwater Can you explain what you did when you said

Removing the call to renderInput for non-searchable select fixed it.

@vitaminwater
Copy link
Author

@adamwan92 I got it to work by changing something in there code, did not make a pull request because of lack of time, and because I don't really know if I'm not breaking anything else.

Maybe @JedWatson got what I was talking about ? Interested in a PR for this ?

@adamthewan
Copy link

adamthewan commented Jun 27, 2016

@vitaminwater A PR or even a copy paste of the code that you changed would help very much!

It's weird cause running the demo (jedwatson.github.io/react-select) works very well on mobile.

@vitaminwater
Copy link
Author

@adamwan92 ok thats' really dirty for now: in node_modules/react-select/lib/Select.js, line 938, replace this.renderInput(valueArray) with this.props.searchable ? this.renderInput(valueArray) : null,.

But honestly I can't really encourage you to do this, the change will be lost as soon as you update the package.

@adamthewan
Copy link

adamthewan commented Jun 27, 2016

@vitaminwater thanks so much for the help!
It turned out to be a Fastclick issue, I had two installed at once (Meteor & React Fastclick) which somehow cancelled each other out.

@peterkuiper
Copy link

Same problem here, is there a PR already? If not I can create one. Not sure if the fix by @vitaminwater is good enough

@NekR
Copy link

NekR commented Jul 26, 2016

I don't know, but I cannot select even on desktop right now (Chrome/macOS)

@idanwe
Copy link

idanwe commented Jan 2, 2017

Fast click has a disable hook, add needsclick class to option element https://github.com/ftlabs/fastclick#ignore-certain-elements-with-needsclick

AlexSapoznikov added a commit to farmersdog/react-select that referenced this issue Jan 18, 2017
@mpigsley
Copy link

Any update on this? @peterkuiper did you get a PR ready?

@peterkuiper
Copy link

@mpigsley Well, at the time we decided to go with a different solution and currently we have rolled on our solution for it. Looking at the open issues and the open PRs, I assume the author is having quite a big backlog. So sorry, no, I did not get a PR ready.

@JedWatson
Copy link
Owner

I'm pretty confident this has been addressed in the latest version, if anyone can still reproduce it please let me know with steps explaining how. Thanks!

@alexeykozlov07
Copy link

react select is still not work on iPhone. I use latest version of react-select

@epozsh
Copy link

epozsh commented Jan 11, 2018

@JedWatson
Hello, i tried toggle device with chrome dev tool,
and cannot select option

@Under-Warz
Copy link

@alexeykozlov07 / @JedWatson add optionClassName="needsclick" worked for me (thx @idanwe )

@mlukjanska
Copy link

mlukjanska commented Mar 2, 2019

For me in react-select v.2.4.0 it works, the issue might have been a conflict due to having react-select-simplevalue included as well.

@CharlieBreval
Copy link

CharlieBreval commented Apr 2, 2019

Make sure not to use a button in your option Component if you want the handleChange to be triggered when selecting an option.
(I'm using v2.4.0)

@florentdestremau
Copy link

Using Firefox 67.0.4, with iPhone 6/7/8 Plus simulator, I can't use the examples on https://react-select.com/home with the mouse. Whenever I hover the dropdown elements the menu closes

@mitayou
Copy link

mitayou commented Mar 7, 2020

@ alexeykozlov07 / @JedWatson添加optionClassName="needsclick"对我有用(thx @idanwe

what can i do?, it seems don't support optionClassName property

@leonardobork
Copy link

@MrYou0 @florentdestremau same as you guys

@georgiosgiatsidis
Copy link

It seems like optionClassName is not a supported property. I overrided Option component instead.

import ReactSelect, { components } from 'react-select';

const CustomOption = props => <components.Option className="needsclick" {...props} />;

<ReactSelect components={{ Option: CustomOption }} />

@ziaulrehman40
Copy link

optionClassName seems to work in latest versions, but this should not be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests