Browse Source

scenario dialog delete button (#1997)

resolves #1995

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
Fred Lefévère-Laoide 7 months ago
parent
commit
f675fbd9a1
1 changed files with 12 additions and 8 deletions
  1. 12 8
      frontend/taipy/src/ScenarioSelector.tsx

+ 12 - 8
frontend/taipy/src/ScenarioSelector.tsx

@@ -370,14 +370,18 @@ const ScenarioEditDialog = ({ scenario, submit, open, actionEdit, configs, close
                     <DialogActions>
                         <Stack direction="row" justifyContent="space-between" sx={ActionContentSx}>
                             {actionEdit && (
-                                <Button
-                                    variant="outlined"
-                                    color="error"
-                                    onClick={onConfirmDialogOpen}
-                                    disabled={!scenario || !scenario[ScFProps.deletable]}
-                                >
-                                    Delete
-                                </Button>
+                                <Tooltip title={scenario && scenario[ScFProps.deletable]}>
+                                    <span>
+                                        <Button
+                                            variant="outlined"
+                                            color="error"
+                                            onClick={onConfirmDialogOpen}
+                                            disabled={!scenario || !scenario[ScFProps.deletable]}
+                                        >
+                                            Delete
+                                        </Button>
+                                    </span>
+                                </Tooltip>
                             )}
                             <Button variant="outlined" color="inherit" onClick={close}>
                                 Cancel