-
-
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
Merged
Merged
+1,542
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1c44b61
to
078ba46
Compare
Switching to RFR |
slax57
requested changes
Apr 29, 2025
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. |
slax57
approved these changes
Apr 29, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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