admin: hint for "ctrl + enter" on form/save buttons
Massimo Melina committed
Nov 12, 2024 at 21:12 UTC
9ec03f572bc9ba4bba2644ef21622382c8a5ccc3
1 file changed
+3
-4
mui-grid-form/index.ts
+3
-4
@@ -4,7 +4,7 @@ import {
4
createElement as h, FC, Fragment, isValidElement, ReactElement, ReactNode, useEffect, useState, useRef,
5
MutableRefObject
6
} from 'react'
7
-import { Box, BoxProps, Button, Grid } from '@mui/material'
7
+import { Box, BoxProps, Button, Grid, Tooltip } from '@mui/material'
8
import { Save } from '@mui/icons-material'
9
import { LoadingButton } from '@mui/lab'
10
import _ from 'lodash'
@@ -186,15 +186,14 @@ export function Form<Values extends Dict>({
186
position: 'sticky', bottom: 0, p: 1, m: -1, boxShadow: '0px 0px 15px #000',
187
},
188
barSx)
189
- },
190
- h(LoadingButton, {
189
+ }, h(Tooltip, { title: "ctrl + enter", children: h(LoadingButton, {
190
variant: 'contained',
191
startIcon: h(Save),
192
children: "Save",
193
loading: useDebounce(phase !== Phase.Idle), // debounce fixes click being ignored at state change, and flickering
194
...saveBtn,
195
onClick: pleaseSubmit,
197
- }),
196
+ }) }),
197
...addToBar,
198
)
199
)