CreativeBulma / bulma-tagsinput

Bulma's extension providing user interface to manage tags supporting autocomplete.
MIT License
62 stars 21 forks source link

Duplicate form data when submitting #1

Closed triszt4n closed 4 years ago

triszt4n commented 4 years ago

I use bulma-tagsinput in a form with name attribute "tags". See this (written in pug.js):

form(id="group-form")
  .field
    label.label Name of group
    .control
      input.input(type="text", name="name", placeholder="Discrete Maths" required)
  .field
    label.label(for="tags") Tags
    .control
      input.input(type="tags", name="tags", id="tags", placeholder="Add tags", value="midterm")
(...)

When I would submit the form, FormData shows two objects under the same key: "tags". One of them has the value of a blank string, the other's value has the data from tagsinput.

Can you tell me what could be behind this?

I already solved it with deleting the blank object, yet I want to know if I was wrong and I could have solved the duplication problem.

CreativeBulma commented 4 years ago

Hi @triszt4n,

Thanks to report this bug. You did nothing wrong it's just the name attribute that was duplicated on the input generated by TagsInput. Fix is coming very soon.

regards