Custom-Selectbox icon indicating copy to clipboard operation
Custom-Selectbox copied to clipboard

Errors with selection & drop-down "search" feature.

Open thecoastisclear opened this issue 13 years ago • 10 comments

Gang - good work on this plugin, however there are some very fatal flaws that are preventing me from using it. I hope my etiquette is proper here, as I've never used github before.

FIrst off - the latest mixer version is what seems to be working the best. However, it still doesn't "close" the drop-down if you hit "enter" on an item.

The biggest problem is that in my list, if I chose an item far down in my list, it does not "select" the right one. As in, the proper value will not be displayed.

Below is my list. If I "Saskatchewan", for example, my custom-selectbox will show "Hawaii" for some reason... I can't get the following to show up as html. Github keeps parsing it... blaaaah

' ' $('#state').sbCustomSelect();

thecoastisclear avatar Feb 14 '12 05:02 thecoastisclear

Can you write an example html file? It's hard to reproduce the problem with just the options contents. What are the values, the css, etc.

cstickel avatar Feb 15 '12 01:02 cstickel

Absolutely, how do I get it to you?

thecoastisclear avatar Feb 15 '12 01:02 thecoastisclear

http://pastebin.com/ would be a possibility. alternatively just upload it to a webserver.

EDIT: oh and please tell me in which browser (and version) you experienced the buggy behavior.

cstickel avatar Feb 15 '12 01:02 cstickel

Here's the link:

http://pastebin.com/raw.php?i=0ChGS6yB

I included the CSS inline. It may not look perfect, but it's the functionality that's not working quite right. This happens in every browser on my Mac (Chrome, FF, & Safari), as well as at least Chrome and FF on my Windows PC. All the latest versions as I religiously keep them updated. If you need exact versions I can look, but I really think that part is irrelevant as the issue is so wide-spread.

thecoastisclear avatar Feb 15 '12 02:02 thecoastisclear

Okey, there are two bugs:

  • Selectbox doesn't seem to work with jquery 1.7 (input doesn't show the value and keyboard navigation doesn't work at all. Items at far bottom aren't selectable)
  • Selecting an item which you've to scroll to doesn't get selected

I'll try to fix both bugs tomorrow morning. The secound bug doesn't seem to be the one you experienced, since you've set a fixed height and get a scrollbar in the dropdown, which works.

Can you please try your example after changing the jquery source to the outdated 1.5 version: http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js Just to check if you still experience bugs i haven't found.

I have to get some sleep now, but i'll fix the jquery 1.7 bug as soon as i get up.

cstickel avatar Feb 15 '12 03:02 cstickel

Ahh, I see both the bugs you mentioned.

The problem I was referring to about it not selecting the right one was partly my error. The Canadian province checkboxes used the same value as some of the US states (from copying the option tags), and because of that the plugin chooses the first option with the selected matching value. If someone has a select box with multiple options that have the same value, this plugin will always select the first of the matching value. I hope that makes sense...

thecoastisclear avatar Feb 15 '12 03:02 thecoastisclear

If you use the version from https://github.com/mixer2/Custom-Selectbox exactly the clicked item should get selected. If it doesn't something is totally wrong.

cstickel avatar Feb 15 '12 03:02 cstickel

Ahh, you are correct. This version does not have that issue.

thecoastisclear avatar Feb 15 '12 03:02 thecoastisclear

Nice, then the 2 identified bugs are all to fix. I'll leave you a comment here as soon as the updated version is available.

cstickel avatar Feb 15 '12 03:02 cstickel

hi, both bugs should be fixed in https://github.com/mixer2/Custom-Selectbox i suggest you use that version, until changes are pulled to the main repository.

first bug with jQuery version (added compatibility for current jquery version, dropped compatibility for versions < 1.6): https://github.com/mixer2/Custom-Selectbox/commit/d75fb7b2a6ecf668f2a6ac12cdfe678ecfaf437e

secound bug (can't select an item with long dropdowns, if you scroll to a position where the select isn't visible anymore in webkit browsers): https://github.com/mixer2/Custom-Selectbox/commit/97578c8c4ba8e7670cad651e5cd7cceaaa8b19eb

cstickel avatar Feb 15 '12 11:02 cstickel