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

DataTable wrong TypeScript definition for row click events #1715

Closed
tft7000 opened this issue Oct 29, 2021 · 1 comment
Closed

DataTable wrong TypeScript definition for row click events #1715

tft7000 opened this issue Oct 29, 2021 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Milestone

Comments

@tft7000
Copy link

tft7000 commented Oct 29, 2021

[ x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

Current behavior
DataTable row-click event is defined as Dom Event in https://github.com/primefaces/primevue/blob/master/src/components/datatable/DataTable.d.ts#L109
However in the Documentation and in the code (https://github.com/primefaces/primevue/blob/master/src/components/datatable/TableBody.vue#L396) the event is an Object in the form:

{
  originalEvent: Event;
  data: any; // or T if that can be made available somehow
  index: number;
}

Expected behavior
correct definition of row-click.

Note
If I compare the 'Events' listing under https://primefaces.org/primevue/showcase/#/datatable with the type definitions at https://github.com/primefaces/primevue/blob/master/src/components/datatable/DataTable.d.ts#L94, I think that most event definitions are not correct.

What is the motivation / use case for changing the behavior?
I get typescript errors because the types are not correct:
error TS2322: Type '(event: { originalEvent: MouseEvent; data: MyModel; index: number; }) => void' is not assignable to type '(event: Event) => void'.

Please tell us about your environment:

  • Vue version: 3.2.20

  • PrimeVue version: 3.8.2

@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Nov 4, 2021
@tugcekucukoglu tugcekucukoglu added this to the 3.8.3 milestone Nov 4, 2021
@tugcekucukoglu tugcekucukoglu self-assigned this Nov 4, 2021
@tugcekucukoglu tugcekucukoglu changed the title Bug: DataTable: Wrong TypeScript Definition for Events DataTable wrong TypeScript definition for row click events Nov 4, 2021
@tft7000
Copy link
Author

tft7000 commented Nov 4, 2021

@tugcekucukoglu : thank you very much

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 vue2-portable
Projects
None yet
Development

No branches or pull requests

2 participants