Keep selected option at the top of the options list. #1871
Unanswered
arek-kilimar-allhuman
asked this question in
Q&A
Replies: 1 comment 1 reply
-
A PR for this was just merged today, it will be available once the next version is released. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to keep chosen option at the top of the list.
I used object like this
const countryCodes = [
{
"country": "Afghanistan",
"pref": "+93",
"code": "AF",
"priority": 1
},
........
adding "priority" set to one for each one and for each onChange I assign lower priority value to the chosen option.
Then I sorted it like this - sortField: ['priority','country']
It works kind of well, but the chosen option shows as the first one only when I choose next one and there is always one step delay.
I thought refreshOptions() would help here, but it doesn't.
Is there any way to make it working properly
Beta Was this translation helpful? Give feedback.
All reactions