-
Notifications
You must be signed in to change notification settings - Fork 8
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
Best practice stories: Use EditDialog
instead of MUIs Dialog
#2901
base: main
Are you sure you want to change the base?
Conversation
…er from showing upon saving
<EditDialog title={mode === "add" ? "Add new item" : `${rows.find((row) => row.id === selectedId)?.title}`}> | ||
<Form id={mode === "add" ? undefined : selectedId} /> | ||
</EditDialog> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomasdax98 is this how the EditDialog should be used with Selection? Seems odd to me...
@@ -975,7 +932,7 @@ export const GridWithSelectionInDialog = { | |||
<ToolbarAutomaticTitleItem /> | |||
<ToolbarFillSpace /> | |||
<ToolbarActions> | |||
<Button color="primary" variant="contained" startIcon={<SelectIcon />} onClick={() => setShowDialog(true)}> | |||
<Button color="primary" variant="contained" startIcon={<SelectIcon />} onClick={() => editDialogApi.openAddDialog()}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be openEditDialog, since you're editing the current selection.
Description
All MUI dialogs in the best practice stories are replaced with
EditDialog
. This adds the dirty handler dialog to prevent losing unsaved changes.Screenshots/screencasts
Saving behaviour:
Screen.Recording.2024-12-09.at.13.34.10.mp4
Error behaviour:
Screen.Recording.2024-12-09.at.13.35.39.mp4
Changeset