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.
<TextEdit />
currently has a few issue, and it's something that causes a lot of issues for menull
, there is no way for the user to know null vs blank.null
and during an edit the user focuses the field but makes no changes, during a save the client will tell the server that the value is""
for strings or0
for numbers. This is an issue where an edit is made without the user even knowing it happened, this can cause validation errors and/or other issues.onBlur
andonKeyDown
which is unnecessary.useEffect
seemingly does nothingThis PR contains a fix to
<TextEdit />
But in addition has a feature proposal that I haven't ironed out yet. I propose to add some form of a reset for the field, it would make it clear to the user that the field has been edited. I have the functionality working, but the styling is pretty bad.
This video showcases the fix for
<TextEdit />
as you are able to focus and unfocus without value change.The "Reset" text will only show for a field that has been modified.
The "Price per" field is actually not fixed since currency type doesn't use the same
<TextEdit />
component, so the old behavior is evident there.