Commit b5d59227 authored by Leopoldthecoder's avatar Leopoldthecoder

Select: get the latest cached option

parent 37ee8e9f
......@@ -363,7 +363,13 @@
},
getOption(value) {
const option = this.cachedOptions.filter(option => option.value === value)[0];
let option;
for (let i = 0, len = this.cachedOptions.length; i < len; i++) {
const cachedOption = this.cachedOptions[i];
if (cachedOption.value === value) {
option = cachedOption;
}
}
if (option) return option;
const label = typeof value === 'string' || typeof value === 'number'
? value : '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment