File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
examples/simple/src/posts
packages/ra-ui-materialui/src/input/InPlaceEditor Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 77 DataTable ,
88 DateField ,
99 EditButton ,
10+ InPlaceEditor ,
1011 NumberField ,
1112 ReferenceArrayField ,
1213 ReferenceManyField ,
@@ -93,7 +94,20 @@ const PostShow = () => {
9394 />
9495 < NumberField source = "average_note" />
9596 < BooleanField source = "commentable" />
96- < TextField source = "views" />
97+ < InPlaceEditor
98+ source = "views"
99+ sx = { {
100+ '& .RaInPlaceEditor-reading div' : {
101+ fontSize : 14 ,
102+ } ,
103+ '& .RaInPlaceEditor-saving div' : {
104+ fontSize : 14 ,
105+ } ,
106+ '& .RaInPlaceEditor-editing input' : {
107+ fontSize : 14 ,
108+ } ,
109+ } }
110+ />
97111 < CloneButton />
98112 </ TabbedShowLayout . Tab >
99113 < TabbedShowLayout . Tab
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import CloseIcon from '@mui/icons-material/Close';
1717
1818import { TextInput } from '../TextInput' ;
1919import { TextField } from '../../field' ;
20+ import { bgcolor } from '@mui/system' ;
2021
2122export type InPlaceEditorAction =
2223 | { type : 'edit' }
@@ -263,11 +264,11 @@ const InPlaceEditorClasses = {
263264const Root = styled ( 'div' , {
264265 name : PREFIX ,
265266 overridesResolver : ( props , styles ) => styles . root ,
266- } ) ( {
267+ } ) ( ( { theme } ) => ( {
267268 [ `& .${ InPlaceEditorClasses . reading } ` ] : {
268269 cursor : 'pointer' ,
269270 '&:hover' : {
270- backgroundColor : ' action.hover' ,
271+ backgroundColor : theme . palette . action . hover ,
271272 } ,
272273 } ,
273274 [ `& .${ InPlaceEditorClasses . editing } ` ] : {
@@ -276,4 +277,4 @@ const Root = styled('div', {
276277 gap : 1 ,
277278 } ,
278279 [ `& .${ InPlaceEditorClasses . saving } ` ] : { opacity : 0.5 } ,
279- } ) ;
280+ } ) ) ;
You can’t perform that action at this time.
0 commit comments