Skip to content

Commit

Permalink
fix(dropdown): handle text metadata on select build dropdowns
Browse files Browse the repository at this point in the history
This PR preserve the data-text attribute when creating the dropdown from a select, so the displayed text can be different than the in-dropdown text.

Closes #1103
  • Loading branch information
prudho authored and Sean committed Dec 22, 2019
1 parent 10b59be commit a0a537b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1966,6 +1966,9 @@ $.fn.dropdown = function(parameters) {
value = ( $option.attr('value') !== undefined )
? $option.attr('value')
: name,
text = ( $option.data(metadata.text) !== undefined )
? $option.data(metadata.text)
: name,
group = $option.parent('optgroup')
;
if(settings.placeholder === 'auto' && value === '') {
Expand All @@ -1983,6 +1986,7 @@ $.fn.dropdown = function(parameters) {
select.values.push({
name : name,
value : value,
text : text,
disabled : disabled
});
}
Expand Down

0 comments on commit a0a537b

Please sign in to comment.