Skip to content

Impossible to edit when using a Proxy as rows props (v7.0.0-canary.33) #2270

@tboyer42

Description

@tboyer42

Since v7.0.0-canary.8, the rowGetter prop which was a nice way to feed the displayed data in a virtualized table has been replaced with the rows prop.
One way to keep the same kind of functionnality was to use a Proxy which would overload the [] operator, so preparing for a future migration that's what I used and it worked.
Unfortunately, after migrating from v7.0.0-canary.7 to v7.0.0-canary.33, it is impossible to edit any cell using a proxy, the problem being the following line : https://github.com/adazzle/react-data-grid/blob/ad691c0507e4eea607ff74df98341ca96c8963bb/src/DataGrid.tsx#L871

replacing with something like this is working though:

if (selectedPosition.mode === 'EDIT' && rowKeyGetter(rows[selectedPosition.rowIdx]) !== rowKeyGetter(selectedPosition.originalRow))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions