Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

2.0: dropdown allowAdditions not working correct with form set values

Open slb235 opened this issue 11 years ago • 3 comments

When using a dropdown with allowAdditions, i.e. for tags, the set values method of form wont take custom added values.

Example: http://jsfiddle.net/rduvhn8u/33/

slb235 avatar Jun 08 '15 16:06 slb235

Seems to be a problem with dropdowns set selected, independent of the form.

Example: http://jsfiddle.net/rduvhn8u/36/

slb235 avatar Jun 08 '15 17:06 slb235

Yes, set selected does not currently work with values not currently found in a dropdown's menu. This is because get item will not find a value to select.

I've spent 30 mins or so fiddling with a workaround, its not quite simple, since other methods expect get item to return false if it is not a user addition. I'll revisit this after launch in a patch release.

jlukic avatar Jun 08 '15 18:06 jlukic

Since I have a hard time leaving obvious bugs open, I've decided to spend a couple hours fixing this.

There were several issues

  • Remove selected did not work with arrays
  • Set selected did not work when setting a user selection
  • Set selected would select placeholder text when value was set to "" (empty string)

I've resolved set selected and remove selected to use a consistent API, and work with userAdditions.

This should be resolved in latest dist/ in next.

jlukic avatar Jun 09 '15 17:06 jlukic