Skip to content

Commit

Permalink
fix: Get label and value from element attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
samwx committed Jun 28, 2018
1 parent c49825f commit 7f16a25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/blipSelect/blipSelectBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,12 @@ export class BlipSelectBase {
*/
_onOptionClick(event) {
if (this.isSelectOpen) {
const selectedOption = this.selectOptions.find(o => o.label === event.target.getAttribute('data-label'))
// const selectedOption = this.selectOptions.find(o => o.label === event.target.getAttribute('data-label'))
const target = event.target
const selectedOption = {
label: target.getAttribute('data-label'),
value: target.getAttribute('data-value'),
}
this._setInputValue(selectedOption)
this._resetSelectedOptions()
event.target.classList.add(blipSelectOptionSeletedClass)
Expand Down

0 comments on commit 7f16a25

Please sign in to comment.