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

Single selects reopen after selection in 4.0.6 #5490

Closed
Hlsgs opened this issue Apr 28, 2019 · 22 comments · Fixed by #5492
Closed

Single selects reopen after selection in 4.0.6 #5490

Hlsgs opened this issue Apr 28, 2019 · 22 comments · Fixed by #5492

Comments

@Hlsgs
Copy link

Hlsgs commented Apr 28, 2019

This causes a flicker if closeOnSelect is on the default true value, either implicit or explicit. Setting closeOnSelect to false avoids the flicker, but is beside the point.
Multi-selects work fine.

@brunnopleffken
Copy link

Same happens here after upgrading to 2.0.6. With single select I'm unable to close the dropdown, it's just flickering and remains open. With multi-selects I can close it but it flickers after selecting an option, I don't remember of this happening before.

@Hlsgs
Copy link
Author

Hlsgs commented Apr 29, 2019

@brunnopleffken it was introduced in 4.0.6 final. Anything upto 4.0.6-rc.1 is fine as far as this goes, but 4.0.5 is probably your safest bet.

@Ariex
Copy link

Ariex commented Apr 29, 2019

this issue is caused by https://github.com/select2/select2/blob/develop/src/js/select2/core.js#L280 this code, if you remove it all works good

@toxpal
Copy link

toxpal commented Apr 29, 2019

I came here to submit this issue after upgrading to 4.0.6, but it looks more people noticed it already. This issue didn't exist in 4.0.5 and 4.0.6 rc

Here's the fiddle for @kevin-brown to see it in action - https://jsfiddle.net/japdL67z/

@markusramsak
Copy link

I can confirm this. I have the same issue. reopening on 'focus' causes this issue - like @Ariex mentioned

@mm98
Copy link

mm98 commented Apr 29, 2019

I can also confirm this.

@kevin-brown
Copy link
Member

That line (and lines surrounding it) were added in #5356. It's not clear why they were added, but I can tell from the jsfiddle provided (thanks!) that it means that Select2 just can't close anymore.

@Ariex
Copy link

Ariex commented Apr 29, 2019

@kevin-brown my understanding is that line could be added so people can use tag to switch to this control then the search box will show automatically, but without that line people can still do that only with an extra "enter" when the text box got the focus. Also with this change, people cannot switch out of this control with tab, they have to click anywhere in this control but the search text box, then "tab" twice to close the drop down.
I think this feature brings more troubles than benefits.

that change was introduced from this PR: 2ea1718#diff-770e771e3300e4531333cd08d3c2f8f1, and there is 1 related issues #3696

@lvillanne
Copy link

Same problem here after upgrading to 4.0.6 final. 4.0.6-rc.1 is fine for me.

@mis4s
Copy link

mis4s commented Apr 29, 2019

Confirm - 4.0.6

@flaushi
Copy link

flaushi commented Apr 29, 2019

Confirm!

@kevin-brown
Copy link
Member

I think this feature brings more troubles than benefits.

Agreed, especially since I just re-reviewed that and it does not appear to solve the original problem.

I welcome a pull request which reverts those changes, and I can roll a new 4.0.7 release after that is merged in.

@Ferroin Ferroin mentioned this issue Apr 30, 2019
3 tasks
kevin-brown pushed a commit that referenced this issue May 1, 2019
It doesn't really do what it says it does, and it introduces other
issues (single select elements re-open after selection).

Fixes #5490
@kevin-brown
Copy link
Member

I just published a 4.0.7-rc.0 version to GitHub and NPM. If someone could confirm that it does in fact fix the issue (and that the regressions aren't catastrophic) on a real-world site that would be greatly appreciated.

CDNs should be catching up shortly.

@Ariex
Copy link

Ariex commented May 1, 2019

works good for me

@mm98
Copy link

mm98 commented May 1, 2019

4.0.6-rc.1 works for me.

@gvdlangenberg
Copy link

4.0.7-rc.0 works!

@Hlsgs
Copy link
Author

Hlsgs commented May 1, 2019

@kevin-brown 4.0.7-rc.0 solves this issue indeed, but introduces #5495.

@toxpal
Copy link

toxpal commented May 1, 2019

I'm so happy to see Kevin continues developing select2 again. I believe it was kind if abandoned for a long time (4.0.6 RC was probably released more than a year ago?), and it's great to see the best select plugin is back!

@silvioq
Copy link

silvioq commented May 1, 2019

I confirm 4.0.7-rc.0 works fine for me

@cosmicvibes
Copy link

4.0.7-rc.0 fixes this.

@herroworrd
Copy link

Perhaps others can confirm but I still get unexpected/broken behaviour with 4.0.7.

My single selects don't close on value select like they should. They won't close until a click outside the selectbox is done. Have tried setting closeOnSelect to true but this has no change.

@D3epDiv3r
Copy link

4.0.6-rc.1 works for me.

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

Successfully merging a pull request may close this issue.