From 91c7c12f7a9dc103cb9cb37240fe9de6faffc984 Mon Sep 17 00:00:00 2001 From: Matheus Wichman Date: Wed, 26 Oct 2022 13:07:43 -0300 Subject: [PATCH] [DataGrid] Remove `disableIgnoreModificationsIfProcessingProps` prop --- docs/data/data-grid/editing/editing.md | 11 -------- .../migration-data-grid-v5.md | 9 ++++--- .../x/api/data-grid/data-grid-premium.json | 1 - docs/pages/x/api/data-grid/data-grid-pro.json | 1 - docs/pages/x/api/data-grid/data-grid.json | 1 - .../data-grid/data-grid-premium-pt.json | 1 - .../data-grid/data-grid-premium-zh.json | 1 - .../api-docs/data-grid/data-grid-premium.json | 1 - .../api-docs/data-grid/data-grid-pro-pt.json | 1 - .../api-docs/data-grid/data-grid-pro-zh.json | 1 - .../api-docs/data-grid/data-grid-pro.json | 1 - .../api-docs/data-grid/data-grid-pt.json | 1 - .../api-docs/data-grid/data-grid-zh.json | 1 - .../api-docs/data-grid/data-grid.json | 1 - .../src/DataGridPremium/DataGridPremium.tsx | 5 ---- .../src/DataGridPro/DataGridPro.tsx | 5 ---- .../tests/cellEditing.DataGridPro.test.tsx | 25 ++++-------------- .../src/tests/rowEditing.DataGridPro.test.tsx | 26 ++++--------------- .../x-data-grid/src/DataGrid/DataGrid.tsx | 5 ---- .../src/DataGrid/useDataGridProps.ts | 1 - .../features/editing/useGridCellEditing.ts | 14 ++-------- .../hooks/features/editing/useGridEditing.ts | 8 +----- .../features/editing/useGridRowEditing.ts | 13 ++-------- .../src/models/props/DataGridProps.ts | 5 ---- 24 files changed, 20 insertions(+), 119 deletions(-) diff --git a/docs/data/data-grid/editing/editing.md b/docs/data/data-grid/editing/editing.md index 3de97f3eba8c..93b3a0231c32 100644 --- a/docs/data/data-grid/editing/editing.md +++ b/docs/data/data-grid/editing/editing.md @@ -237,17 +237,6 @@ While the promise is not resolved, the edit component will receive an `isProcess {{"demo": "ValidateServerNameGrid.js", "bg": "inline", "defaultCodeOpen": false}} -:::warning -If the user performs an action that saves the changes and exits the edit mode (e.g. pressing Enter) while the props are still being processed, the changes will be discarded upon exit. -To avoid this, use the `disableIgnoreModificationsIfProcessingProps` prop to keep the cell or row in edit mode while props are processed: - -```tsx - -``` - -In v6, this prop will be removed and the editing API will behave, by default, like if it was enabled. -::: - ## Persistence The `processRowUpdate` prop is called when the user performs an action to [stop editing](#stop-editing). diff --git a/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md b/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md index 52403c9b6ff8..ff58edc63364 100644 --- a/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md +++ b/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md @@ -38,6 +38,11 @@ Below are described the steps you need to make to migrate from v5 to v6. - The `selectionChange` event was renamed to `rowSelectionChange`. +### Removed props + +- The `disableIgnoreModificationsIfProcessingProps` prop was removed and its behavior when `true` was incorporated as the default behavior. + The old behavior can be restored by using `apiRef.current.stopRowEditMode({ ignoreModifications: true })` or `apiRef.current.stopCellEditMode({ ignoreModifications: true })`. +