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

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

Open
thecoastisclear opened this issue Feb 14, 2012 · 10 comments
Open

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

thecoastisclear opened this issue Feb 14, 2012 · 10 comments

Comments

@thecoastisclear
Copy link

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

'select your state
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
--------------
PROVINCES
Alberta
British Columbia
Manitoba
New Brunswick
New Foundland
Northwest Territories
Nova Scotia
Ontario
Prince Edward Island
Quebec
Saskatchewan
Yukon
'
$('#state').sbCustomSelect();

@cstickel
Copy link

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.

@thecoastisclear
Copy link
Author

Absolutely, how do I get it to you?

@cstickel
Copy link

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.

@thecoastisclear
Copy link
Author

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.

@cstickel
Copy link

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.

@thecoastisclear
Copy link
Author

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...

@cstickel
Copy link

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.

@thecoastisclear
Copy link
Author

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

@cstickel
Copy link

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
Copy link

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):
cstickel@d75fb7b

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):
cstickel@97578c8

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

2 participants