-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
InputControl: Fix undo when changing padding values #40518
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
070a66e
Fix undo when changing padding values
youknowriad 769e69d
Finish making `InputControl` et al. more controllable (#40568)
stokesman bbdbfc8
Fix `RangeControl` reset from values out-of-range by multiple digits
stokesman 80e7d58
Add changelog entry
stokesman f1f4daa
Revert "Fix `RangeControl` reset from values out-of-range by multiple…
stokesman 0de33ab
Revert "Finish making `InputControl` et al. more controllable (#40568)"
stokesman 8952d45
Have `InputControl` favor entered value for a render cycle
stokesman 32eb218
Run propagation effect when `isDirty` changes
stokesman bb6b932
Use event existence to eliminate extraneous `onChange` calls
stokesman d79aa03
Keep change handler in a ref to pass `react-hooks/exhaustive-deps`
stokesman 3ac6020
Cleanup legacy `event.persist` calls
stokesman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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.
Two reasons for switching to
dispatch
:reset
is typed to require passing an event for the second argument and I didn't want to change the typing because in most cases it would be important to pass the event.exhaustive-deps
lint rule knowsdispatch
is stable and won't complain when it's not in the dependencies.My remaining peeve with this is I think it'd be better to not reuse
RESET
here and maybe reintroduceUPDATE
. It's only a theoretical concern only and for now a non-issue. The concern would be that someday a component wants to specializeRESET
in a way that should not happen every time the value prop has changed.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.
Thanks for the explanation of
dispatch
overreset
, it makes sense. I also agree regardingRESET
vsUPDATE
and that it is a potential future concern but that can be addressed down the line and separately to this PR.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.
This sounds like a good point, if we were to keep the internal reducer!
At the same time, after this fix is merged I'd like to explore ways to simplify
InputControl
(and consequently its derived components), including the removal of the internal reducer (see this comment for more details)