2

is there a class similar to a SelectWidget which allows to select multiple items from a list in the OOUI library? I want to use that in a MediaWiki VisualEditor instance I'm extending.

I guess I can also rewrite SelectWidget myself, but yeah maybe there's a solution already.

Volker E.
  • 5,911
  • 11
  • 47
  • 64
Jdv
  • 962
  • 10
  • 34

1 Answers1

2

OOUI appears to have only CapsuleMultiselectWidget (tag list / capsule control).

Also, you should note this is a JS-only widget (no PHP implementation, or "PHP pendant" in OOUI-speak).

After quite an extensive search, it appears there's no simpler multi-select dropdown - there are a few open tasks to implement one:

  • T91147: Create a generalised multi-select widget
  • T108489: Generalise CapsuleMultiselectWidget into a MultiselectWidget
  • T117782: Implement CheckboxMultiselectWidget (and CheckboxMultiselectInputWidget)
Volker E.
  • 5,911
  • 11
  • 47
  • 64
Dror S.
  • 1,090
  • 8
  • 20
  • Well, I used the existing Select Widget and adjusted it so that multiple items can be selected. Not too much work. If someone is interested, I can post it here when I'll lay my hands on the project the next time. – Jdv May 26 '16 at 13:31
  • @Jacob S, that'd be nice - if you do that, I'll link to this question from the relevant issue. – Dror S. May 26 '16 at 15:50
  • 1
    That's how I changed it: http://pasted.co/3d2d57d8 I only changed stuff until it did what I wanted it to do; so it's likely there are some functionalities I didn't refactor yet. It's also possible that I did some dumb decisions there as I'm new to JS/web development in general. – Jdv Jun 02 '16 at 10:56
  • Notice, that CapsuleMultiselectWidget was replaced by superior TagMultiselectWidget in latest version of OOUI https://doc.wikimedia.org/oojs-ui/master/demos/?page=widgets&theme=wikimediaui&direction=ltr&platform=desktop#TagMultiselectWidget-allowArbitrary-inline-input-placeholder – Volker E. Oct 03 '18 at 19:40