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

Comments

@NellyHaglund
Copy link

commented Aug 14, 2019

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
Merge pull request #987 from NellyHaglund/bugfix/nested-original-event
Fixed #986 - Avoid nested originalEvent in onSelectionChange

@mertsincan mertsincan self-assigned this Aug 27, 2019

@mertsincan mertsincan added the defect label Aug 27, 2019

@mertsincan mertsincan added this to the 3.1.9 milestone Aug 27, 2019

@mertsincan

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

Thanks a lot for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.