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

ConfirmDialog: 'defaultFocus' property missing from ConfirmationOptions.d.ts, causing TypeScript errors #2058

Closed
titou10titou10 opened this issue Jan 29, 2022 · 0 comments · Fixed by #2082
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@titou10titou10
Copy link
Contributor

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting

ComponentConfirmDialogprovides adefaultFocusproperty. In any case (ie when set to`"reject") , the ConfirmDialog works as expected

Current behavior
Unfortunately, this attribute is missing from ConfirmationOptions.d.ts, causing validation errors in TypeScript: Having:

 this.$confirm.require({
    {...}
    defaultFocus: 'reject',
    {...}

Causes:

 Argument of type '{ message: string; header: string; icon: string; acceptClass: string; defaultFocus: string; acceptLabel: string; rejectLabel: string; accept: () => void; }' is not assignable to parameter of type 'ConfirmationOptions'.
 Object literal may only specify known properties, and 'defaultFocus' does not exist in type 'ConfirmationOptions'.ts(2345)

Expected behavior
AttributedefaultFocusbeing defined inConfirmationOptions.d.tsso there is no validation/compilation errors
Again, the component is working as designed with this attribute, it's just a TypeScript validation/compilation error

Please tell us about your environment:

  • Microsoft Visual Studio Code v1.63.2 + volar v0.31.1
  • Vue version: v3.2.25
  • PrimeVue version: v3.11.0
  • Vite v2.7.2
  • typescript v4.5.5
@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 30, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.11.2 milestone Feb 11, 2022
@tugcekucukoglu tugcekucukoglu self-assigned this Feb 11, 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

Successfully merging a pull request may close this issue.

2 participants