Draggable / formeo

Drag & Drop Form Builder
http://draggable.github.io/formeo/
MIT License
534 stars 196 forks source link

Feature: Select form control multiselect #280

Open MitchellVermaning opened 4 years ago

MitchellVermaning commented 4 years ago

Hello,

Thank you for this great library.

I added to a new form control the attribute multiple on the HTML element select (form/select.js). When I set two options to selected, only the last selected option will be highlighted.

--

HTML preview: image

HTML rendered the following code: image

--

To reproduce this problem:

  1. Copy the code from form/select.js.
  2. Add multiple: true to attrs. Like: image
  3. Add the following options:
    [
    {
      label: "test1",
      value: "test1",
      selected: true
    }, {
      label: "test2",
      value: "test2",
      selected: true
    }, {
      label: "test3",
      value: "test3",
    }
    ]
  4. When you rendered the form, only option test2 will be selected. While the HTML code has selected test1 and test2.

Do you have any idea how I can resolve this problem? Thank you!