solidjs / solid

A declarative, efficient, and flexible JavaScript library for building user interfaces.
https://solidjs.com
MIT License
32.06k stars 914 forks source link

InputHTMLAttributes does not have all native input attributes #1642

Closed jesseb34r closed 1 year ago

jesseb34r commented 1 year ago

Describe the bug

The InputHTMLAttributes interface does not have all of the attributes of the native <input /> element. Specifically it doesn't handle the attributes that depend on the specified input type.

I initially ran into this bug when using a Kobalte text field input with type="search" and adding the incremental attribute that is specific to <input type="search">. It errors because the solidjs InputHTMLAttributes type does not include incremental.

Your Example Website or App

https://playground.solidjs.com/anonymous/67880890-0ca4-416b-a3a4-744398c71ff1

Steps to Reproduce the Bug or Issue

add the incremental attribute to an <input> element with type="search" and it will type error.

Expected behavior

I expected <input type="search" incremental /> to be valid

Screenshots or Videos

image

Platform

solid-js version 1.6.11

Additional context

No response

jesseb34r commented 1 year ago

The HTML spec for the input element describes the expected attributes for each type

ryansolid commented 1 year ago

Definitely open to PRs here. We got our types from other JSX libraries and some of those are older so we added them as we found them.

Our JSX types can be found in this package: https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/jsx.d.ts

jesseb34r commented 1 year ago

Yeah I linked the types file in the issue above. I will see if I can make a PR for this in the next week. It will be my first PR to a major OSS project like this so I might need some help, I'll reach out on discord if I have questions.

elite174 commented 1 year ago

@jesseb34r https://github.com/ryansolid/dom-expressions/pull/225 Could you check this?

titoBouzout commented 1 year ago

This issue can be closed, it already has been merged in dom-expressions.

ryansolid commented 1 year ago

Thanks.