jimmywarting / FormData

HTML5 `FormData` polyfill for Browsers and nodejs
MIT License
360 stars 102 forks source link

<select /> emits "undefined" in entries() #38

Closed clschnei closed 6 years ago

clschnei commented 6 years ago

Instead of using the select element's "name" in the tuples, the constructor is using the option's "name". This appears to be inconsistent with the spec.

Lines in question: https://github.com/jimmywarting/FormData/blob/59e46d05b70c9ea0db4d52ef4ccbbbc77afac3aa/FormData.js#L131-L133

jimmywarting commented 6 years ago

Guess you are right So it should be like this: this.append(elm.name, opt.value)?

clschnei commented 6 years ago

That's what I'm guessing. I actually forked the branch, and am in the middle of adding unit tests as well.

Tried using jest but their current jsdom version doesn't implement selectedOptions. Trying to decide whether to mount the new version manually, or switch to karma + Chrome headless.

jimmywarting commented 6 years ago

I would love to have a unit test. Karma seems like the best option. Since we are targeting real browsers. the we could test more browsers also

jimmywarting commented 6 years ago

closed in daab62a9d4ca014757e2d0beb2c34f8ffa065e46