| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
test package_version#rc |
Sorry, something went wrong.
|
test package_version#rc |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
cherry-picked from #7426
What is the current behavior?
ObservableArray splice does not notify the number of updated items and it can't be inferred from the passed arguments.
What is the new behavior?
ObservableArray splice adds all updated items to addedCount, using a logic of "x items removed, y items added in their place"
The amount of change in the length of the array can be always inferred by addedCount - removed.length.
This fixes a bug that would cause FormattedString.spans.splice to keep removing spans and never adding any back.
Fixes #7425.
BREAKING CHANGES:
The addedCount variable from ObservableArray's splice change event is always the amount of added items.
Migration steps:
Ideally, developers should handle the case where items are replaced by splice. The old addedCount can be obtained by
const addedCount = event.addedCount - event.removed.length