[Dropdown] item data value is cleared when dropdown message is shown #3622

Closed
mdehoog opened this Issue Jan 29, 2016 · 1 comment

Projects

None yet

2 participants

@mdehoog
Contributor
mdehoog commented Jan 29, 2016

When creating a searchable dropdown from existing HTML, the dropdown item's value property in the element data is cleared when searching and no results are available. This is because, when the "No results" message is shown, the menuObserver mutation observer is fired which calls module.refresh(), which in turn calls module.refreshData() which removes the value and text data values from the item elements.

Here is a jsbin that reproduces the issue: http://jsbin.com/runetopasi/edit?html,js,output

Here is the code that removes the value and text data from the items: https://github.com/Semantic-Org/Semantic-UI/blob/04a3c48a0dd3bd9b440b59036004409239a6db16/src/definitions/modules/dropdown.js#L385-L387. Could you please explain the reason behind this code? Otherwise, simply removing these lines will fix this issue.

@jlukic jlukic added this to the 2.2 milestone Mar 6, 2016
@mdehoog mdehoog added a commit to mdehoog/Semantic-UI that referenced this issue Mar 28, 2016
@mdehoog mdehoog Removed deletion of text/value metadata from dropdown items (fixes #3622
)
abd75a4
@mdehoog mdehoog added a commit to mdehoog/Semantic-UI that referenced this issue Mar 28, 2016
@mdehoog mdehoog Cherry pick: removed deletion of text/value metadata from dropdown it…
…ems (fixes #3622)
74b7a2d
@jlukic jlukic modified the milestone: 2.1.9, 2.2 Mar 28, 2016
@jlukic jlukic modified the milestone: 2.1.9, 2.2 May 4, 2016
@jlukic jlukic added a commit that referenced this issue May 15, 2016
@jlukic jlukic Fixes #3879, #3622 - mutation observers occur erroneously with intern…
…al updates, causing issues
6562429
@jlukic
Member
jlukic commented May 15, 2016

See #3879 for response

@jlukic jlukic closed this May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment