fomantic / Fomantic-UI

Fomantic-UI is the official community fork of Semantic-UI
https://fomantic-ui.com
MIT License
3.56k stars 331 forks source link

[Dropddow] Items are not updated when remove manually #2998

Open Jasonlgrd opened 8 months ago

Jasonlgrd commented 8 months ago

Bug Report

When I add item in input value manually and I call $('.ui.selection.dropdown').data().moduleDropdown.trigger.change(); it works. The items in dropdown are correctly added. But, when I remove item in input value manally and I call $('.ui.selection.dropdown').data().moduleDropdown.trigger.change(); it doesn't work.

Steps to reproduce

I have created JsFiddle to simply reproduce this bug.

  1. In dropdown, select 3 or 4 elements.
  2. Check the DOM, you can see input with right value and all <a /> elements
  3. Click on the "Remove button"
  4. Check the DOM, you can see input with last element is removed but the <a /> element is always there.

Expected result

When item is removed and $('.ui.selection.dropdown').data().moduleDropdown.trigger.change(); is called, the <a /> element should be removed from the DOM.

Actual result

The <a /> element isn't removed from the DOM, so he is always display in dropdown.

Testcase

Screenshot (if possible)

Version

2.x.x

lubber-de commented 8 months ago

Fixed by #3000 See your adjusted jsfiddle here https://jsfiddle.net/lubber/v6eth3qu/

Jasonlgrd commented 8 months ago

Oh nice ! I'm waiting a new release now, thanks of lot !