Page MenuHomePhabricator

Replace Chosen with select2
Open, LowestPublic

Description

Hi, I was looking for an awesome way to display selects with icons (and some more markup like smaller a smaller description text below each keyword) and allow adding "multiple tags".

Since Chosen[1] does not support HTML in its rendered result (or at least this is not documented[2]), is there any way to get rid of it and instead use select2[3]?

At least its documentation is a lot more extensive.

[1] https://git.wikimedia.org/blob/mediawiki%2Fcore.git/ca0bbe33e3d719d88683daab36c4b7326ca42b9e/resources%2Fjquery.chosen%2Fchosen.jquery.js
[2] http://harvesthq.github.io/chosen/
[3] http://ivaynberg.github.io/select2/select2-latest.html


Version: 1.22.0
Severity: normal

Details

Reference
bz51443

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:02 AM
bzimport set Reference to bz51443.
bzimport added a subscriber: Unknown Object (MLST).

I'm not opposed, as long as the HTMLForm multi select behavior continues to work. It seems that select2 is better maintained than chosen.

matmarex renamed this task from Chosen vs. select2 to Replace Chosen with select2.Dec 21 2014, 6:26 PM
matmarex lowered the priority of this task from Low to Lowest.
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).

I wouldn't say this is quite a duplicate — T88250 dealt specifically with OOUI, this is about replacing one external with another. As noted above but even more true now, select2 is somewhat more maintained and featureful (cf. https://github.com/harvesthq/chosen/pull/166)

Maintainers of chosen just yesterday marked it as deprecated and unmaintained: https://github.com/harvesthq/chosen/commit/91041bc9dd6867f9a1668050a1b092d92027f13b

AFAICT cdnjs doesn't have a policy for removal (https://github.com/cdnjs/cdnjs/issues/12144) so I don't think the upstream is likely to cause issues, but I'd say this gives more proof it should be replaced in core. @Rillke I've reopened this, hope that's alright.

Jdlrobson subscribed.

perhaps the frontend standards group can come up with a plan for dealing with this.