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

Checkbox typings insufficient #1191

Closed
besserwisser opened this issue Apr 19, 2021 · 0 comments
Closed

Checkbox typings insufficient #1191

besserwisser opened this issue Apr 19, 2021 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@besserwisser
Copy link

besserwisser commented Apr 19, 2021

Problem:
The Checkbox typings are only allowing null or undefined for the value and modelValue attribute. So no string is allowed.

interface CheckboxProps {
    value?: null;
    modelValue?: null;
    binary?: boolean;
}

Error:

Type 'string' is not assignable to type 'null | undefined'.ts(2322)

Reproduce error:

<Checkbox
  :id="'test-id'"
  v-model="testModel"
  :value="'Test-Value'"
/>

Workaround for now:
Casting the value to any before using in template

Expectations:
value und modelValue should accept at least strings and numbers.

@besserwisser besserwisser changed the title Checkbox typings Checkbox typings insufficient Apr 19, 2021
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working priority - low labels May 10, 2021
@cagataycivici cagataycivici added this to the 3.5.0 milestone May 11, 2021
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

3 participants