(index: number)
| 794 | } |
| 795 | |
| 796 | _select(index: number) { |
| 797 | const selectedIndex = this._selectedIndex; |
| 798 | if (index < 0 || index >= this.options.length || this.options.length === 0) { |
| 799 | return; |
| 800 | } |
| 801 | if (this.options[selectedIndex]) { |
| 802 | this.options[selectedIndex].selected = false; |
| 803 | } |
| 804 | |
| 805 | const selectedOption = this.options[index]; |
| 806 | if (selectedIndex !== index) { |
| 807 | this.fireDecoratorEvent("live-change", { selectedOption }); |
| 808 | } |
| 809 | |
| 810 | selectedOption.selected = true; |
| 811 | if (this._valueStorage !== undefined) { |
| 812 | this._setValueByOption(selectedOption); |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | /** |
| 817 | * The user clicked on an item from the list |
no test coverage detected