Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The type of inputProps prop requires every possible attribute for HTMLInputElement type #2891

Closed
Defrosted opened this issue Aug 25, 2022 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Defrosted
Copy link

Defrosted commented Aug 25, 2022

Describe the bug

The typing for the inputProps prop for components AutoComplete, Dropdown, CascadeSelect, and MultiSelect require a full object of all possible attributes specified under the HTMLInputElement-type which leads to TypeScript errors.

I imagine the typing for this prop should be something like Partial<HTMLInputElement>. The props panelProps for each component seem to have the same kind of typing.

Possibly related to issues #2831, #2822, #2814, and #2811.

Reproducer

No response

PrimeVue version

3.16.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Create one of the specified components
  2. Give it the inputProps prop with an object like { name: 'username' }
  3. TypeScript gives an error Type '{ name: string; }' is missing the following properties from type 'HTMLInputElement': accept, align, alt, autocomplete, and 332 more. for the inputProps prop.

Expected behavior

I'm expecting to be required to pass only the attributes needed, e.g. 'name', to the underlying input element instead of every possible attribute specified under the type HTMLInputElement.

@Defrosted Defrosted added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Aug 25, 2022
@mertsincan mertsincan self-assigned this Aug 25, 2022
@mertsincan mertsincan added this to the 3.17.0 milestone Aug 25, 2022
@mertsincan mertsincan changed the title AutoComplete, Dropdown, CascadeSelect, MultiSelect: The type of inputProps prop requires every possible attribute for HTMLInputElement type The type of inputProps prop requires every possible attribute for HTMLInputElement type Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants