I'm getting this in this case of an HTMLOptionElement value

It should have that value as HTMLOptionsCollection contains HTMLOptionElement elements:
readonly options: HTMLOptionsCollection;
interface HTMLOptionsCollection extends HTMLCollectionOf<HTMLOptionElement> {
length: number;
selectedIndex: number;
add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;
remove(index: number): void;
}
Using [email protected]
My workaround was to use an unnecessary cast
let newValue = (target.options[newSelectedIndex] as HTMLOptionElement).value
Probably this is because the indexer of HTMLCollectionOf only returns Element, not HTMLOptionElement.
The generic should return type of T right?
That's right.
Please fix!
That would be awesome!
Most helpful comment
Please fix!