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

Nested originalEvent in DataTable header RowCheckbox event #986

Closed
NellyHaglund opened this issue Aug 14, 2019 · 1 comment · Fixed by #987
Closed

Nested originalEvent in DataTable header RowCheckbox event #986

NellyHaglund opened this issue Aug 14, 2019 · 1 comment · Fixed by #987
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@NellyHaglund
Copy link
Contributor

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

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

DataTable multiple selection onSelectionChange event object differs if triggered from DataTable header row than from DataTable body row.

<DataTable value={this.state.cars} selection={this.state.selectedCars} onSelectionChange={e => console.log(e)}>
  <Column selectionMode="multiple" />
</DataTable

Current behavior

onSelectionChange triggered from DataTable header row:

{
  originalEvent: {
    checked: null,
    data: null,
    originalEvent: {
      altKey: (...)
      bubbles: (...)
      button: (...)
    }
  },
  value: []
}

onSelectionChange triggered from DataTable body row:

{
 originalEvent: {
    altKey: (...)
    bubbles: (...)
    button: (...)
  }
  value: []
}

Expected behavior
The object should be structured the same, without nested originalEvent.

Expected: onSelectionChange triggered from DataTable header row:

{
 originalEvent: {
    altKey: (...)
    bubbles: (...)
    button: (...)
  },
  checked: null,
  data: null,
  value: []
}
  • PrimeReact version:
    3.1.7
NellyHaglund pushed a commit to NellyHaglund/primereact that referenced this issue Aug 14, 2019
mertsincan added a commit that referenced this issue Aug 27, 2019
Fixed #986 - Avoid nested originalEvent in onSelectionChange
@mertsincan mertsincan self-assigned this Aug 27, 2019
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Aug 27, 2019
@mertsincan mertsincan added this to the 3.1.9 milestone Aug 27, 2019
@mertsincan
Copy link
Member

Thanks a lot for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants