Skip to content

Commit

Permalink
Merge pull request #191 from redding/jcr-fix-setting-empty-select-dis…
Browse files Browse the repository at this point in the history
…play

Fix select displaying an empty text option as selected
  • Loading branch information
jcredding committed Oct 23, 2017
2 parents 33c9641 + 6ac664f commit 7d6cf1a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions assets/js/romo/select.js
Expand Up @@ -273,14 +273,16 @@ RomoSelect.prototype._refreshUI = function() {
text = '';
this.romoSelectedOptionsList.doRefreshUI();
} else {
text = Romo.find(this.elem, 'OPTION[value="'+this._elemValues()[0]+'"]').innerText.trim();
}
if (text === '') {
text = ' '
var optionElem = Romo.find(this.elem, 'OPTION[value="'+this._elemValues()[0]+'"]')[0];
text = optionElem.innerText.trim();
}

var textElem = Romo.find(this.romoSelectDropdown.elem, '.romo-select-text')[0];
Romo.updateText(textElem, text);
if (text === '') {
Romo.updateHtml(textElem, ' ');
} else {
Romo.updateText(textElem, text);
}
}

RomoSelect.prototype._onCaretClick = function(e) {
Expand Down

0 comments on commit 7d6cf1a

Please sign in to comment.