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

Adds sortable option to select2 tags input field #423

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joker-777
Copy link

@joker-777 joker-777 commented Sep 22, 2022

  • it allows the user to sort the tags in the select2 field when a 'sortable' option is specified
  • it uses the sortable plugin from jquery-ui since it is included in activeadmin
  • it remove the sorting in array_to_select_options because it shouldn't change the original order
  • Github issue: Add sortable option to select2 tags field #422

* it allows the user to sort the tags in the select2 field when a 'sortable' option is specified
* it uses the sortable plugin from jquery-ui since it is included in activeadmin
* it remove the sorting in `array_to_select_options` because it shouldn't change the original order
@joker-777 joker-777 changed the title adds sortable option to select2 tags input field adds sortable option to select2 tags input field (422) Sep 22, 2022
@joker-777 joker-777 changed the title adds sortable option to select2 tags input field (422) adds sortable option to select2 tags input field (https://github.com/platanus/activeadmin_addons/issues/422) Sep 22, 2022
@joker-777 joker-777 changed the title adds sortable option to select2 tags input field (https://github.com/platanus/activeadmin_addons/issues/422) adds sortable option to select2 tags input field ([422](https://github.com/platanus/activeadmin_addons/issues/422)) Sep 22, 2022
@joker-777 joker-777 changed the title adds sortable option to select2 tags input field ([422](https://github.com/platanus/activeadmin_addons/issues/422)) adds sortable option to select2 tags input field Sep 22, 2022
@joker-777 joker-777 changed the title adds sortable option to select2 tags input field Adds sortable option to select2 tags input field Sep 22, 2022
@difernandez
Copy link
Contributor

Hi, sorry for the late reply. This looks interesting, but unfortunately we have released a beta for v2 where we drop support for select2, so these changes wouldn't work directly. Would you be willing to rebase from master and adapt this so it works with slim select, the alternative we are now using? I can then review this PR more thoroughly.
Also, a couple comments I have from giving it a quick look:

  • Do you think you could add a simple test case for this? I'm not familiar with how easy or difficult it would be to test a drag and drop thing like this, but maybe there is an attribute's presence that can be tested or something?
  • Even if jquery-ui is included in activeadmin, I think we should add it to the package.json to be more explicit with our dependencies

@joker-777
Copy link
Author

@difernandez Thanks a lot for your message. We will definitely try out the new version you are going to release. Although, I'm not sure yet when this will happen. Then I will also look into this issue. Slim select definitely looks interesting.

@difernandez
Copy link
Contributor

@joker-777 we don't have an ETA on when we're going to release v2 out of beta, we want to test it a little more and see if we find any issues. But the current beta version should be stable, if you want to try it there. Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants