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
Swapping beforeChange
and afterSetDataAtCell/afterSetDataAtRowProp
hooks order
#10231
Merged
Conversation
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
wszymanski
changed the title
Swapping
Swapping Feb 3, 2023
beforeChange
and afterSetDataAtCell/afterSetDataAtRowProp
hooksbeforeChange
and afterSetDataAtCell/afterSetDataAtRowProp
hooks
… (it will fix the problem), changed one test
Launch the local version of documentation by running: npm run docs:review 573f827d6d564e4d967cc7849a422a678a925d15 |
wszymanski
changed the title
Swapping
Swapping Feb 6, 2023
beforeChange
and afterSetDataAtCell/afterSetDataAtRowProp
hooksbeforeChange
and afterSetDataAtCell/afterSetDataAtRowProp
hooks order
…ontable into feature/dev-issue-677
budnix
requested changes
Feb 7, 2023
Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>
Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>
budnix
previously approved these changes
Feb 8, 2023
budnix
approved these changes
Jun 12, 2023
I made sure that the new order of hooks also works for merging, opening the editor after crud operations, with undo and redo. |
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.
Context
So far, there have been called
afterSetDataAtCell
andafterSetDataAtRowProp
hooks, beforebeforeChange
hook. There will be change in that order. What's more, places where editor is closed andnulls
created usingbeforeChange
hooks are filtered out have been changed.It will fix problem described within #6932 as
afterSetDataAtCell
will handle proper value (right after applying changes frombeforeChange
hook).Was:
afterSetDataAtCell
/afterSetDataAtRowProp
hook ->beforeChange
hook -> closing an editor (when necessary - stops next actions) -> async validation -> applying changes ->afterChange
hookWill be (🔴 breaking change):
beforeChange
hook -> closing an editor (when necessary + next actions after calling theafterSetData*
hook won't be executed) ->afterSetDataAtCell
/afterSetDataAtRowProp
hook (data changed bybeforeChange
hooks including effect ofsplice
method, with filterednull
s) -> async validation -> applying changes ->afterChange
hookHow has this been tested?
I tested a table by using API methods, such as:
afterSetDataAtCell
,afterSetDataAtRowProp
,populateFromArray
and performing autofill, clearing cells or editing them. While dong such actions I have been performing manipulations insidechanges
array (being abeforeChange
hook's argument) by reassignment of array's element or usingsplice
method.Types of changes
Related issue(s):
Affected project(s):
handsontable
@handsontable/angular
@handsontable/react
@handsontable/vue
@handsontable/vue3
Checklist: