-
Notifications
You must be signed in to change notification settings - Fork 31
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
Clicking scrollbar in dropdown box closes dropdown #81
Comments
Which version are you using? I created a fiddle at https://jsfiddle.net/gjsjohnmurray/p17y09f9/ and wasn't able to reproduce what you reported. |
I'm using the latest version: 1.1.26 I forked your JSFiddle and added the scombobox configuration options I am using on the website I'm working on. I can reproduce the same problem using Google Chrome Version 46.0.2490.86 (64-bit): |
When I run your fiddle with my Chrome (47.0.2526.106 m) on 64-bit Windows 8.1 Pro, I click the dropdown button and the list appears. I can click the scrollbar's down-arrow, or click in the scroll-column below the scroll-marker. The list remains open and the contents scroll as expected. It also works this way for me on Firefox (44.0b1) and on IE (11.0.26) |
That's strange. I develop mainly on a Linux system (OpenSuse 13.2 KDE) and this is where I'm having this problem. I just tested my fiddle on the latest version of Google Chrome for Mac OS X and cannot reproduce it there. The dropdown stays open as expected. It's also good to know that the problem does not occur on a Windows system. Thanks for testing that. I'm not sure if it's worth investigating any further, since it could be just some obscure problem with KDE. A possible workaround I could think of is letting the plugin only close the dropdown when an item (paragraph element) has been clicked (or selected with enter key) or when the input field loses focus. I created a video demonstrating the problem: https://drive.google.com/file/d/0B_gSlXOo3tt_Z05BcllteGFfRlk/view?usp=sharing |
The logic for closing the dropdown is mainly in lines 765-800 of jquery.scombobox.js (line numbers referring to 3f19c5f). On blur from the input field we have to try and work out whether focus is being lost to another element that's a component of the same scombobox, or to elsewhere. Possibly the 200ms timer is expiring before an event from the component manages to cancel it. Or perhaps Chrome on your environment behaves like IE apparently does when clicking onto the scroller parts of the div that displays the dropped-down list. The comments at 770-772 say that such an action on IE gives us a blur but no suitable subsequent event from which to deduce that the blur wasn't away from the scombobox. |
Having this problem on windows 10 x64 with IE11. It seems that the problem is on the onBlur event as stated. Has anyone found a way to fix it? |
I know this is a little old, but if people are still having problems with this, clearing the timeout on mouse up and the capture of the scroll event seemed to solve the problem for me:
@gjsjohnmurraywould you consider including something this in the plugin? |
@wdbsb are you able to reproduce the problem with either of the fiddles above? If so, what browser version and platform? If not, can you create a fiddle to demonstrate the issue? |
@gjsjohnmurray Thanks for the reply. I haven't managed to reproduce it in a simple case. What I have noticed is that for some reason in my situation clicking or scrolling the scrollbar on the div in the scombobox causes a blur event on the scombobox's input control ("scombobox-display"). That does not happen in the simple examples. Apparently the blur event (or lack of it) due to scrolling a div is a common problem. Googling "scrollbar triggers blur" comes up with many other select replacements in JS libraries! I'll get back to you when I have a better answer. |
@gjsjohnmurray OK, I've partially figured it out. It has to do with putting the scombobox in a jQuery UI dialog box. The code below shows the problem in the current versions of Firefox and Chrome but works fine in IE11. Unfortunately, it also does not show the problem if I put it in a fiddle. Have you heard of anyone else having bad interactions with jQuery UI dialogs and scombobox?
|
Clicking the scrollbar in the dropdown box immediately closes the dropdown, so the only options for navigating through the list is by using the mouse wheel or the up / down keys.
The text was updated successfully, but these errors were encountered: