Replies: 5 comments 1 reply
-
Don't set sortField https://jsfiddle.net/59r1cnoL/ |
Beta Was this translation helpful? Give feedback.
-
Nope, this is my list: https://jsfiddle.net/ursbraem/0pymckve/3/ To reproduce, type "B" |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks for the clear example. I clearly forgot how the sortField setting works. Just posted the solution on a similar issue Essentially, this: sortField: [{field:'$order'},{field:'$score'}], |
Beta Was this translation helpful? Give feedback.
-
To specify direction (ascending or descending):
For that, you'll need a custom sorting function which will be available in the next RC release. See the sort callback option for sifter |
Beta Was this translation helpful? Give feedback.
-
I still get an irregular sorting https://jsfiddle.net/ursbraem/y6fswonp/3/ when typing in one letter (B -> Bex, Baar, Belp), not the wrong direction but mixed up. But I think we can leave it there, tom select is so good overall (we used chosen before which doesn't play along on mobile at all) so that isn't a blocker. Thanks Josh! |
Beta Was this translation helpful? Give feedback.
-
We have a plain select with 2000 options, and a vanilla implementation of tom select:
Now if the user types a single letter, tom select will mess up the order.
I saw the
sortField
property, also in the basic example at https://tom-select.js.org/examples/, but this produces no effect. Maybe because there are 2k entries to be sorted? Or how do I instruct the plugin to maintain the initial sorting?Beta Was this translation helpful? Give feedback.
All reactions