In _autocomplete_widgets_get_options_allowvals the limit on returned autocomplete (usually 10, and a setting parameter would be good for that) is applied with:
if ($count >= $limit) {
break;
}
And later the sort is made with:
_autocomplete_widgets_sort_options($options, $instance);
The conséquence is a really bad user experience where you type for example "samsung" and get a list of 10 samsung mobiles (with 1 or 2 Galaxy inside and some other mobiles - all starting with samsung), and when typing galaxy you have a list of 10 samsung galaxy mobiles. Based on the first typing the user may think the list contains only 2 samsung-galaxy when it can provide 25 of them. This is an example.
But the user experience bug seems quite obvious for me, sort operations should be applied before limiting the result, as done in databases. This may impact badly big lists.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | autocomplete_widgets-fix_sort_applied_before_limit-1894408-2.patch | 1.37 KB | regilero |
Comments
Comment #1
regilero commentedHere's a patch for that.
Comment #2
bleen commentedthis fix looks fine to me (except for the minor whitespace issues) ... but it needs tests.
Thanks for submitting this patch