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

Fix menu closing when click outside the menu box #2314

Merged
merged 1 commit into from
Jul 4, 2018
Merged

Fix menu closing when click outside the menu box #2314

merged 1 commit into from
Jul 4, 2018

Conversation

ytiurin
Copy link
Contributor

@ytiurin ytiurin commented Jan 19, 2018

This refers to the issue #2239

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 95.225% when pulling 25dc020 on ytiurin:master into 82910d9 on JedWatson:master.

@vitorhorta
Copy link

Is this PR merged? Looking forward for this fix!

@lifejuggler
Copy link

I was wondering when this will be merged in?

@eugensunic
Copy link

eugensunic commented Feb 22, 2018 via email

@jboelen
Copy link

jboelen commented Feb 22, 2018

@eugensunic Looks like this was approved but not merged?
https://github.com/JedWatson/react-select/blob/master/src/Select.js#L205-L219

@eugensunic
Copy link

eugensunic commented Feb 22, 2018 via email

@jboelen
Copy link

jboelen commented Feb 22, 2018

Sorry if I'm missing something, but the commit that corresponds to version 1.2.1 shows that the lines remain unchanged.

react-select/lib/Select.js

Lines 251 to 265 in 82910d9

value: function toggleTouchOutsideEvent(enabled) {
if (enabled) {
if (!document.addEventListener && document.attachEvent) {
document.attachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.addEventListener('touchstart', this.handleTouchOutside);
}
} else {
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
}
}
}

I've also checked the source from npm for v1.2.1, and it shows the same unchanged lines.

node_modules/react-select/dist/react-select.es.js
image

@vitorhorta
Copy link

@jboelen did you get any news on this PR? Still not merged here.

@abstract071
Copy link

I had trouble with closing select. The problem was that I set display: none to input element under react select. After removing this the behavior became ok.
Maybe it will be helpful for someone :)

@willmore
Copy link

willmore commented Mar 29, 2018

@ytiurin despite comments stating this has been merged, it appears otherwise.

Is there an ETA on merging? Thank you.

@RocketPuppy
Copy link

We are also looking for this to be merged.

@abraham-chan
Copy link

ping @eugensunic PR approved but not merged/released?

@hle50
Copy link

hle50 commented Apr 10, 2018

we are waiting for this to be merged

@RealSilo
Copy link

Could you pls merge this?

@willmore
Copy link

@JedWatson appealing to you as the project owner. How do we get this merged in a "timely" manner? In general, what should be the expected time between reviewer approval merge? Thank you.

@JedWatson
Copy link
Owner

JedWatson commented Apr 14, 2018

Responding specifically to @willmore's question, and please read my tone as constructive:

In general, what should be the expected time between reviewer approval merge?

I think you're talking about the "approval" by @eugensunic, and asking how long is reasonable to wait between that and the PR being merged and released?

To clarify, GitHub allows anyone to "Approve" a PR, regardless of their relationship to the project. But without the reviewer providing explanation or context for the core team it's effectively just a different kind of "thumbs up" from the community. I mean no offence, but this PR hasn't been reviewed or approved by anyone on the react-select team yet.

How do we get this merged in a "timely" manner?

Sorry this hasn't been dealt with yet - I've been spending a huge amount of time prepping v2 (see #2289) for final release and haven't had a lot of bandwidth for responding to v1 PRs and issues.

The things making this take longer include:

  • Most of the discussion in the referenced issue is around confusion that the code in master hadn't been published in a version yet; that's been done, but the symptom of menu closing seems to still be active
  • There are reports that the bug has indeed been solved, but not everybody agrees
  • There are no clear instructions on how to reproduce, or linked codesandbox implementations demonstrating the issue
  • There is no explanation with this PR about what the identified problem is or how this fixes it

So, explaining my view as a maintainer, this PR has no clarity or explanation. It's just a change to code and I'm not clear on what the change does or why it is important. I'm also not clear what the root cause of the reported issue is or how to reproduce it. From the comments in the linked issue, not everybody is experiencing it which means that any change needs to be careful to address all use-cases and not break anything else that's currently working for users.

If these things were clearer, I could more quickly resolve the issue and merge the PR or request changes.

In the meantime, it's in the backlog, and I'll get to it when I have time to dedicate to understanding the problem and proposed solution comprehensively.

@JedWatson
Copy link
Owner

I do realise that stronger guidelines for issues and PRs would help clarify why this is waiting, and result in less frustration and better quality contributions over all. I'll try and set that up in the future.

I'm also sure there are a lot of open issues and PRs that would benefit from this kind of clarity, and if anybody wants to help me manage that it would be really helpful.

@ytiurin
Copy link
Contributor Author

ytiurin commented Apr 16, 2018

Hi guys, more details about this commit from my side. The component menu closes on input blur, but doesn't close in case when input field is not used in the component. I think there was a code some time before, to handle no-input menu closing because we have this code for touch outside menu. So this commit handle situation when there is no input element visible on screen.

@willmore
Copy link

I'm also sure there are a lot of open issues and PRs that would benefit from this kind of clarity, and if anybody wants to help me manage that it would be really helpful.

Thank you for your comments @JedWatson! I will ask members of my team whether they are interested and able to contribute.

@jossmac jossmac merged commit f9bdb97 into JedWatson:master Jul 4, 2018
@jossmac
Copy link
Collaborator

jossmac commented Jul 4, 2018

Thanks @ytiurin 🙂

@TheSharpieOne
Copy link
Contributor

This change appears to have broken the closeOnSelect={false} functionality of v1. since the mousedown listener will fire the handleTouchOutside and always determine that the target is not within the wrapper (since the target is removed from the DOM), it will always fire this.menuClose().

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

Successfully merging this pull request may close these issues.

None yet