-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
New setting 'blankSortBy' + minor bug fixes #36
Conversation
This new setting allows a different sort to be used when the input is blank. 'initial' sort type does not apply any sorting, so will appear in the same order as the original select options.
Line 116: allowMismatchBlank would set the value to blank, but the flexselect would still reset the displayed selection if allowMismatch was false. Add else to second if statement so both do not occur Lines 119-120: Remove dropdownList.show() on blur of flexselect when hideDropdownOnEmptyInput=true, seems to serve no purpose. Lines 239-245: Move hide/show logic of hideDropdownOnEmptyInput to the end of filterResults() instead of keyUp(). This will now apply when a flexselect is clicked active. Change dropdownList to dropdown, so an empty box with the border still visible does not show
New Setting: blankSortBy
Could you help me here and give me some concrete use-cases as to why you'd want to change this default (blank input) sort behavior? Especially, why should |
Hi, I used this plug-in (great by the way! thanks!) in a project of mine where the users needed to filter a large list of clients, scoring was the best way to sort these with an appropriate search. When the input was blank, it would still use score (hence ensuring the Sorting by name/alphabetically was the main purpose when I built this, I only implemented While the vast majority of cases would be better with |
Ah! Thanks for the detailed follow-up. This helps a ton, and I'm much more willing to pull this in now. |
Thanks for this. I just merged it in, but I also added a bit of a refactoring of it. Note the changes here: f00524c
|
v0.9.0 released! |
Looks great! Glad I could contribute. |
This new setting allows a different sort to be used when the input is
blank. 'initial' sort type does not apply any sorting, so will appear in
the same order as the original select options.
Minor bug fixes as detailed in 'Bug Fixes' commit