angular-select2 icon indicating copy to clipboard operation
angular-select2 copied to clipboard

Update for select 4.x?

Open yellow1912 opened this issue 9 years ago • 14 comments

The new select2 introduces quite a few BC, among them is the deprecation of hidden field in various places. I wonder if this plugin is ready for 4.x and if not do you have any plan to support it?

yellow1912 avatar Mar 10 '15 17:03 yellow1912

I'd love to, but I have no plans to do so myself until it comes out of beta. Will happily start accepting patches on a branch though. On 10 Mar 2015 18:31, "yellow1912" [email protected] wrote:

The new select2 introduces quite a few BC, among them is the deprecation of hidden field in various places. I wonder if this plugin is ready for 4.x and if not do you have any plan to support it?

— Reply to this email directly or view it on GitHub https://github.com/rubenv/angular-select2/issues/18.

rubenv avatar Mar 10 '15 18:03 rubenv

4.x has been in the RC phase, it looks like a big change and introduce some API changes that may break this component. Especially the .select2('val') has been removed and favor $.val() and opts.query has been deprecated and favor new DataAdapter.

I try to hack a little on the current code, but failed. This component is a little bit complicated than I think...

oliverzy avatar Mar 18 '15 02:03 oliverzy

Hi everyone!

I just discovered this plugin (angular-select2) and noticed this ticket was open. I wouldn't mind taking a shot at converting this over, as long as there are somewhat-updated tests that I can bounce changes off of. I think this plugin might be easier to convert, as long as there aren't any major hacks, and I wouldn't mind replacing the now-deprecated ui-select2 in the AngularJS line of the Select2 readme.

kevin-brown avatar Mar 22 '15 14:03 kevin-brown

Actually, I'm using the new select 2 4.x right now, and I discover that for the most part you don't even need a custom angularjs directive for it. The reason is that they moved from using input to select completely so you can simply plug the ngModel to that select element and it works nicely. There may be some edge cases but I haven't encountered yet.

yellow1912 avatar Mar 22 '15 14:03 yellow1912

Right now the Select2 4.0 is out of beta. Any estimation to make angular-select2 compatible with Select2 4.0 ?

https://select2.github.io/announcements-4.0.html

rbatllet avatar Aug 15 '15 10:08 rbatllet

@rbatllet I'm guessing that it'll be quite a bit of work. Given that select2 3.x works perfectly fine, it's not a priority for us to upgrade (plenty of other work to do).

Anyone who wants to help out is welcome to, I'll gladly setup a branch where we can start working and will happily review/accept pull requests. But for now I (nor my company) won't be making the effort myself.

rubenv avatar Aug 15 '15 10:08 rubenv

@rubenv Please go forward setting up that branch so that PRs can be made against it, thanks

motin avatar Sep 01 '15 12:09 motin

I started here: https://github.com/motin/angular-select2/tree/select2-4.0-support-wip feel free to chip in :)

motin avatar Sep 01 '15 19:09 motin

It's basically "done". https://github.com/motin/angular-select2/tree/select2-4.0-support-wip JS Bin here: https://jsbin.com/gipezidemi/edit?html,js,output

To make it work with select2 4.0 showed out to be a minor task, thanks to the fact that the underlying element is now a select-element and not an input-element. Most of the directive's code could be removed, and the select2 examples from the readme works as expected.

However, I have not updated any of the tests in the repo (nor will I), and there are probably additional features that were included in the previous angular-select2 that are now broken, so additional work may need to be done. Anyway, it is a start, let me know when there is a branch for 4.0 support work against which I can submit a PR. Thanks.

motin avatar Sep 02 '15 06:09 motin

Am currently traveling but will do so soon. Thanks for picking this up! On Sep 2, 2015 8:16 AM, "Fredrik Wollsén" [email protected] wrote:

It's basically "done". https://github.com/motin/angular-select2/tree/select2-4.0-support-wip JS Bin here: https://jsbin.com/gipezidemi/edit?html,js,output

To make it work with select2 4.0 showed out to be a minor task, thanks to the fact that the underlying element is now a select-element and not an input-element. Most of the directive's code could be removed, and the select2 examples from the readme works as expected.

However, I have not updated any of the tests in the repo (nor will I), and there are probably additional features that were included in the previous angular-select2 that are now broken, so additional work may need to be done. Anyway, it is a start, let me know when there is a branch for 4.0 support work against which I can submit a PR. Thanks.

— Reply to this email directly or view it on GitHub https://github.com/rubenv/angular-select2/issues/18#issuecomment-136947428 .

rubenv avatar Sep 02 '15 07:09 rubenv

+1

piernik avatar Sep 12 '15 09:09 piernik

@motin, great simple solution

voznik avatar Sep 12 '15 10:09 voznik

I've pushed a v4 branch, pull requests are welcome. Once this branch is stable, we'll merge it to master and we'll split off a maintenance branch for the older select2 variant.

rubenv avatar Sep 16 '15 08:09 rubenv

What about v4 support?

piernik avatar Oct 05 '15 08:10 piernik