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

[DataGrid] Fix Tab between portaled and non-portaled edit components #7098

Merged
merged 4 commits into from
Jan 6, 2023

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented Dec 6, 2022

Fixes #7034

Before: https://codesandbox.io/s/immutable-sun-2y5jp1?file=/demo.tsx
After: https://codesandbox.io/s/dazzling-bush-79x3cs?file=/demo.tsx

Release

Breaking changes

  • The cellKeyDown event will also be fired for keyboard events that occur inside components that use Portals. This affects specially custom edit components, where pressing a shortcut key will trigger the stop editing routine. For instance, pressing Enter inside the Portal will cause the change to be saved. The onCellEditStop (or onRowEditStop) prop can be used to restore the old behavior.

    <DataGrid
      onCellEditStop={(params, event) => {
        if (params.reason !== GridCellEditStopReasons.enterKeyDown) {
          return;
        }
        // Check if the target is inside a Portal
        if (!event.currentTarget.contains(event.target)) {
          event.defaultMuiPrevented = true;
        }
      }}
    />

@m4theushw m4theushw added the component: data grid This is the name of the generic UI component, not the React module! label Dec 6, 2022
@mui-bot
Copy link

mui-bot commented Dec 6, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-7098--material-ui-x.netlify.app/

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 630 939.9 676.3 749.7 128.53
Sort 100k rows ms 589.2 1,069.8 804 844.6 155.364
Select 100k rows ms 219.1 336.8 270.2 271.22 39.881
Deselect 100k rows ms 153.5 275 187.8 202 41.658

Generated by 🚫 dangerJS against 1bbe9f4

@m4theushw m4theushw marked this pull request as ready for review December 6, 2022 12:33
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 3, 2023
@github-actions
Copy link

github-actions bot commented Jan 3, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 6, 2023
@m4theushw m4theushw merged commit 9a1cc74 into mui:next Jan 6, 2023
@m4theushw m4theushw deleted the tab-portaled-edit-component branch January 6, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Tabindex in data grid with multiline editing
3 participants