()
| 170 | } |
| 171 | |
| 172 | private attachEvents() { |
| 173 | this.selectEl.addEventListener("click", (e) => { |
| 174 | e.stopPropagation(); |
| 175 | this.toggle(); |
| 176 | }); |
| 177 | |
| 178 | this.containerEl.ownerDocument.addEventListener("click", (e) => { |
| 179 | if (this.isOpen && !this.containerEl.contains(e.target as Node)) { |
| 180 | this.close(); |
| 181 | } |
| 182 | }); |
| 183 | } |
| 184 | |
| 185 | addOption(value: string, label: string) { |
| 186 | this.options.set(value, label); |
no test coverage detected