-
Notifications
You must be signed in to change notification settings - Fork 25
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
Keyboard selection behavior and bugfixes. #11
base: master
Are you sure you want to change the base?
Conversation
… from normal select boxes.
* changed keyboard selection to behave more like native select boxes
* dropdownSelection doesn't throw an error anymore, if you click on the ul but not on the a element (for example if the ul has padding and someone clicks on the free space)
…down and without triggering change event * up, down keys and search while dropdown is open doesn't trigger change event but update input value and keep dropdown open (just like native selectboxes) * hideDropdown should now work as expected
…ves problem with leading whitespaces)
* improved readability * fixed missing preventDefault, for up,down,right,left keys, if there is no next or prev element
…objects (improved performance and correct behavior for selects with 2 options with the same value) * removed selectboxCounter * performance improvements * cleaned source * event delegation for all events (cleaner source + better performance) * bugfix for scroll position recovery * updated tests to match fixed behavior
…election won't work after scrolling) * more responsive fade animations (stop them that they can't stack if an dropdown gets closed and reopened very fast multiple times) * close dropdown for all mousebuttons for clicks outside the dropdown
sorry for this huge pull request, i'll add some comments to the diff to make it more simple to understand.
as soon as the pull request is merged i'll add this two points to the issue tracker. |
@@ -1,130 +1,192 @@ | |||
(function($) { | |||
var selectboxCounter = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no reason to keep selectboxCounter, since data-id isn't in use anymore
return false; | ||
} | ||
}); | ||
if(hideAfter) $current.parent().hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If dropdown was hidden, hide it again. Else keep it open.
} | ||
|
||
var fixDropdownPositions = function(element) { | ||
if (settings.appendTo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to do if appendTo isn't used.
* improved performance for fixDropdownPositions (important if polling setting is used)
… dropdown has a scrollbar) * updated jQuery version * added compatibility for current jQuery version (dropped compatibility for pre 1.6 jQuery)
… select items, while sb-input isn't in the visible area (scrolling with long dropdowns) in webkit browsers)
…k the first time after scrolling in the dropdown
any progress on this? There seems to be some good stuff here. |
Change event should not be fired on init or if value hasn't changed. Additionally the change event should only be fired at the end of a change (when dropdown gets closed). This behavior differed from normal select boxes.
Selection by keyboard had a lot of bugs and didn't behave like native browser checkboxes.
New behavior is:
See commit messages for complete list of bugfixes.
Tested with latest Chrome and Firefox.