stencil icon indicating copy to clipboard operation
stencil copied to clipboard

bug: `autofocus` prop/attr is defined on other HTML attribute types instead of `HTMLAttributes`

Open jcfranco opened this issue 1 year ago • 1 comments

Prerequisites

Stencil Version

4.17.2

Current Behavior

Setting the global autofocus attribute/prop will cause TypeScript to complain about missing definition.

The following codepen shows that custom elements inherit it from HTMLElement.

Expected Behavior

For autofocus prop/attr to be included in the base Stencil HTML attr/prop types.

System Info

No response

Steps to Reproduce

Follow provided steps in repro case.

Code Reproduction URL

https://github.com/jcfranco/stencil-autofocus-missing-on-base-html-attr-type

Additional Information

This could apply to other global attributes.

jcfranco avatar May 02 '24 23:05 jcfranco

Hey @jcfranco 👋

Thanks for the bug report!

I wasn't able to see the build failure you were describing, but was able to see errors in my editor related to the type checker (see the screenshot below). Screenshot 2024-05-03 at 10 12 15 AM

Regardless, I think this is a reasonable request/bug/thing we can fix. I see #5727 - I'll discuss that with the team internally today.

Thanks again!

rwaskiewicz avatar May 03 '24 14:05 rwaskiewicz

A fix for this was included in today's v4.18.2 release!

tanner-reits avatar May 20 '24 18:05 tanner-reits