Choices/src/scripts/lib/htmlElementGuards.ts
Simon Kohlmeyer 942306572a Render options without a group even if groups are present.
Closes #615.

This pushes the conversion of OPTION/OPTGROUP elements to Choice objects
into the WrappedSelect class and unifies the code paths a little between
groups-present and groups-not-present.

Some work towards possibly fixing #615
2023-04-05 02:02:03 +02:00

6 lines
195 B
TypeScript

export const isHTMLOption = (e: Element): e is HTMLOptionElement =>
e.tagName === 'OPTION';
export const isHTMLOptgroup = (e: Element): e is HTMLOptGroupElement =>
e.tagName === 'OPTGROUP';