InlineEdit
InlineEdit
Wrap over the inline edit elements.
jsx
import InlineEdit from '@semcore/ui/inline-edit';
<InlineEdit />;InlineEditProps
& {...}| Name | Type | Description |
|---|---|---|
| editable | boolean | Determines which children should be displayed |
| onEditableChange | (editable: boolean, event: React.SyntheticEvent) => void | Callback for editable states changes |
| defaultEditable | boolean | Default value if `editable` property is not provided |
| onEdit | () => void | Fired when user clicks on view children, expects `editable` property be switched to `true` value. Note: there not pair callback that expects switch to edit mode, you should be handled by yourself |
| locale | string | Specifies the locale for i18n support |
InlineEdit.View
All children of InlineEdit.View is displayed when editable property of InlineEdit is set to false. When editable property is set to true, children elements still persist in DOM, but hidden via CSS opacity.
jsx
import InlineEdit from '@semcore/ui/inline-edit';
<InlineEdit.View />;InlineEdit.Edit
All children of InlineEdit.Edit is displayed when editable property of InlineEdit is set to true.
jsx
import InlineEdit from '@semcore/ui/inline-edit';
<InlineEdit.Edit />;