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 row-select and row-unselect index is always undefined #2068

Closed
sid-6581 opened this issue Jan 31, 2022 · 0 comments
Closed

DataTable row-select and row-unselect index is always undefined #2068

sid-6581 opened this issue Jan 31, 2022 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Milestone

Comments

@sid-6581
Copy link
Contributor

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

[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

CodeSandbox Case (Bug Reports)

Edit youthful-cherry-7y1hd

Current behavior

Currently when clicking a row in a DataTable, row-select and row-unselect always have index as undefined.

Expected behavior

row-select and row-unselect should have the actual index of the clicked item.

Minimal reproduction of the problem with instructions

It appears the problem is because onRowClick in DataTable.vue is using event.index instead of e.index in the emit. event is the original browser event, whereas e is the event generated by DTTableBody, which contains the index. Changing event.index to e.index in onRowClick fixes the issue.

What is the motivation / use case for changing the behavior?

The current behavior is incorrect.

  • Vue version: 3.2.29

  • PrimeVue version: 3.11.1

  • Browser: all

@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Feb 1, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.12.1 milestone Feb 24, 2022
@tugcekucukoglu tugcekucukoglu self-assigned this Feb 24, 2022
@tugcekucukoglu tugcekucukoglu changed the title DataTable row-selected index is always undefined DataTable row-select and row-unselect index is always undefined Feb 24, 2022
tugcekucukoglu added a commit to tugcekucukoglu/primevue that referenced this issue Feb 24, 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 vue2-portable
Projects
None yet
Development

No branches or pull requests

2 participants