Skip to content
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

Keep selection order #2119

Open
royfrancis opened this issue Oct 17, 2018 · 3 comments
Open

Keep selection order #2119

royfrancis opened this issue Oct 17, 2018 · 3 comments
Milestone

Comments

@royfrancis
Copy link

royfrancis commented Oct 17, 2018

I find that bootstrap-select returns selected items (multiple selection) in alphabetical order regardless of the actual order of selection. Is it possible to keep the order of selection?

@royfrancis royfrancis changed the title Maintain selection order Keep selection order Oct 17, 2018
@ram02z
Copy link

ram02z commented Apr 13, 2020

Any solutions?

@stebogit
Copy link

stebogit commented Feb 9, 2021

This does work for me

const picker = $('#mySelect');

picker.on('loaded.bs.select', selectedFirst);
picker.on('change.bs.select', selectedFirst);

function selectedFirst () {
  $(this).find('option:selected').prependTo(this);
  $(this).selectpicker('refresh');
}

@Igna43
Copy link

Igna43 commented Jul 28, 2021

@stebogit Hi! How is it possible to implement such solution? I'm attempting to change the behaviour of shinywidgets::pickerInput.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants