fix: forward onItemPrepend/onItemAppend to ArrayFunctions #7516
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.
Description
All array inputs are passed
onItemPrepend
andonItemAppend
that they can call to append and prepend items. Still, the default array input(s) defines their own internal handlers for these two events and passes them on to the ArrayFunctions component. This is both unneccesary, and also makes it harder to customize the behavior by passing in a different onItemAppend function to the array input. This PR removes the redundant handleItemPrepend/handleItemAppend handlers in the standard array inputs.What to review
Does the changes make sense?
I also additionally refactored the internal append/prepend handlers so they build upon the default insertion handler and aligned some naming with current convention (e.g. changed from
handleAppendItem
tohandleItemAppend
)Testing
There should not be any significant differences to how this works today, and existing tests should catch any regressions.
Notes for release