-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add <InPlaceEditor>
for edit-in-place
#10690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1c44b61
to
078ba46
Compare
Switching to RFR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that this new component works very well and the UX is 👌
packages/ra-ui-materialui/src/input/InPlaceEditor/InPlaceEditor.tsx
Outdated
Show resolved
Hide resolved
packages/ra-ui-materialui/src/input/InPlaceEditor/InPlaceEditor.stories.tsx
Outdated
Show resolved
Hide resolved
packages/ra-ui-materialui/src/input/InPlaceEditor/InPlaceEditor.Card.stories.tsx
Show resolved
Hide resolved
packages/ra-ui-materialui/src/input/InPlaceEditor/InPlaceEditor.stories.tsx
Show resolved
Hide resolved
Thanks for the great review, I've taken most of your comments into account and added my comments where I disagree. |
To use this in Or could some prop be added to enable that behavior? |
@dalen Integrating For editable datagrid, we recommend using |
Problem
To edit a value from a record, users have to leave the current screen to go to an Edit view (or use
EditInDialog
, but they will also lose context).Solution
<InPlaceEditor>
renders a field from the current record. On click, it switches to an editable state, allowing the user to change the value directly.InPlaceEditor.mp4
Use this component to let users edit parts of a record directly in the list or detail view. It is useful for quick edits without navigating to a separate edit page.
The field changes color on hover, to indicate that it is editable. The user can cancel the edit by pressing Escape. The field is saved automatically when the user clicks outside of it or presses Enter. While it is being saved, the field is disabled and a loading spinner is shown. If the save fails, an error message is displayed and the original value is restored.
This component can even help replace the
<EditableDatagrid>
:InPlaceEditorDataTable.mov
How To Test
http://localhost:9010/?path=/story/ra-ui-materialui-input-inplaceeditor--basic
Additional Checks
master
for a bugfix or a documentation fix, ornext
for a feature