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

Datable: onCellUnselect event object is different in mobile and desktop #7388

Open
anicarrr opened this issue Nov 5, 2024 · 0 comments
Open
Labels
Device: Mobile Issue or pull request is *only* related to Mobile device

Comments

@anicarrr
Copy link

anicarrr commented Nov 5, 2024

Describe the bug

DataTable component has different object model for the event onCellUnselect in mobile and desktop, it is missing many fields in mobile version.

Mobile version:

originalEvent: [object],
cellIndex: [number],
rowIndex:  [number],
type: [string]

Desktop version:

originalEvent: [object],
cellIndex: [number],  
rowIndex:  [number],
type: [string],
rowData: [object],
selected: [boolean],
props: [object],
column: [object],
field: [string],
value: [string]

I'm using the following props:

<DataTable
  value={...}
  scrollable
  showGridlines
  cellSelection
  selectionMode="multiple"
  selection={...}
  headerColumnGroup={headerGroup}
  isDataSelectable={isCellSelectable}
  onCellSelect={handleCellSelectEvent}
  onCellUnselect={handleCellUnselectEvent}
  cellClassName={cellClassName}
  loading={isLoadingPatient || isUpdating}
  rowGroupMode="rowspan"
  groupRowsBy={"someKey"}
>
...
</DataTable>

Reproducer

No response

System Information

System:
    OS: macOS 14.6.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 418.16 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    npm: 10.8.1 - ~/.nvm/versions/node/v20.15.0/bin/npm
  Browsers:
    Chrome: 130.0.6723.92
    Safari: 17.6
  npmPackages:
    primereact: ^10.8.4 => 10.8.4
    react: ^18.3.1 => 18.3.1

Steps to reproduce the behavior

  1. Create a DataTable component and set onCellSelected and onCellUnselected events
  2. Log object from onCellUnselected callback function in Desktop and Mobile

Expected behavior

Object model from onCellUnselected callback function to be equal in mobile and desktop

@anicarrr anicarrr added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 5, 2024
@melloware melloware added Device: Mobile Issue or pull request is *only* related to Mobile device and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 5, 2024
@anicarrr anicarrr changed the title Datable onCellUnselect event object is different in mobile and desktop Datable: onCellUnselect event object is different in mobile and desktop Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Device: Mobile Issue or pull request is *only* related to Mobile device
Projects
None yet
Development

No branches or pull requests

2 participants