()
| 50 | } |
| 51 | |
| 52 | synchronizeOptions() { |
| 53 | let value = this.value; |
| 54 | let isArray; |
| 55 | |
| 56 | if (Array.isArray(value)) { |
| 57 | isArray = true; |
| 58 | } |
| 59 | |
| 60 | let options = this.element.options; |
| 61 | let i = options.length; |
| 62 | let matcher = this.element.matcher || ((a, b) => a === b); |
| 63 | while (i--) { |
| 64 | let option = options.item(i); |
| 65 | let optionValue = option.hasOwnProperty('model') ? option.model : option.value; |
| 66 | if (isArray) { |
| 67 | option.selected = value.findIndex(item => !!matcher(optionValue, item)) !== -1; // eslint-disable-line no-loop-func |
| 68 | continue; |
| 69 | } |
| 70 | option.selected = !!matcher(optionValue, value); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | synchronizeValue() { |
| 75 | let options = this.element.options; |
no test coverage detected