You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React-admin keeps track of the form state, so it can detect when the user leaves an `Edit` or `Create` page with unsaved changes. To avoid data loss, you can use this ability to ask the user to confirm before leaving a page with unsaved changes.
338
+
React-admin keeps track of the form state, so it can detect when the user leaves an `Edit` or `Create` page with unsaved changes. To avoid data loss, you can use this ability to ask the user to confirm before leaving a page with unsaved changes.
339
339
340
340

**Warning**: This feature only works if you have a dependency on react-router 6.3.0 **at most**. The react-router team disabled this possibility in react-router 6.4, so `warnWhenUnsavedChanges` will silently fail with react-router 6.4 or later.
355
355
356
+
## `sx`: CSS API
357
+
358
+
The `<AccordionForm>` component accepts the usual `className` prop. You can also override the styles of the inner components thanks to the `sx` property. This property accepts the following subclasses:
|`&.MuiAccordion-root`| Applied to all the Accordions |
364
+
|`&.Mui-expanded`| Applied to the expanded Accordions |
365
+
|`&.MuiAccordionSummary-root`| Applied to the Accordion's title |
366
+
|`&.MuiCollapse-root`| Applied to the Accordion's content |
367
+
356
368
## `<AccordionForm.Panel>`
357
369
358
370
The children of `<AccordionForm>` must be `<AccordionForm.Panel>` elements.
@@ -371,6 +383,7 @@ Here are all the props you can set on the `<AccordionForm.Panel>` component:
371
383
|`defaultExpanded`| Optional |`boolean`|`false`| Set to true to have the accordion expanded by default (except if autoClose = true on the parent) |
372
384
|`disabled`| Optional |`boolean`|`false`| If true, the accordion will be displayed in a disabled state. |
373
385
|`square`| Optional |`boolean`|`false`| If true, rounded corners are disabled. |
386
+
|`sx`| Optional |`Object`| - | An object containing the MUI style overrides to apply to the root component. |
374
387
375
388
```tsx
376
389
import {
@@ -520,7 +533,7 @@ Check [the `<AutoSave>` component](./AutoSave.md) documentation for more details
520
533
521
534
## Role-Based Access Control (RBAC)
522
535
523
-
Fine-grained permissions control can be added by using the [`<AccordionForm>`](./AuthRBAC.md#accordionform), [`<AccordionFormPanel>`](./AuthRBAC.md#accordionform) and [`<AccordionSection>`](./AuthRBAC.md#accordionsection) components provided by the `@react-admin/ra-enterprise` package.
536
+
Fine-grained permissions control can be added by using the [`<AccordionForm>`](./AuthRBAC.md#accordionform), [`<AccordionFormPanel>`](./AuthRBAC.md#accordionform) and [`<AccordionSection>`](./AuthRBAC.md#accordionsection) components provided by the `@react-admin/ra-enterprise` package.
0 commit comments