g-plane / typed-query-selector

Better typed `querySelector` and `querySelectorAll`.

Home Page:https://www.npmjs.com/package/typed-query-selector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for :is is inconsistent

stof opened this issue · comments

:is(a, button).js-button-state is inferred as HTMLAnchorElement|HTMLButtonElement as expected. However, swapping the 2 selectors as .js-button-state:is(a, button) does not infer them that way but as Element.

My guess is that it tries to expand that as .js-button-statea, .js-button-statebutton when expanding the :is function, which is broken

@g-plane thanks for the quick fix. That's great (even though it was not blocking me as I went with the swapped selectors)