-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: Updating collection when items change parents #8052
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
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
snowystinger
approved these changes
Apr 8, 2025
reidbarber
approved these changes
Apr 8, 2025
ritz078
added a commit
to PSPDFKit-labs/react-spectrum
that referenced
this pull request
Apr 10, 2025
* chore: Fix generated code sample for S2 TooltipTrigger docs (adobe#8000) * Fix generated code sample for S2 TooltipTrigger docs * review * inlining * fix: export SortDescriptor type from S2 (adobe#8030) * chore: Deprecate UNSTABLE_portalContainer in favor for PortalProvider (adobe#7976) * Initial refactor to tear out UNSTABLE_portalContainer in favor of the PortalContainer * yarn.lock update * switch to deprecating UNSTABLE_portalContainer * prefer deprecated prop over context to make this a non-breaking change * add rough docs * updating copy to include explaination of UNSTABLE * rename to UNSAFE_PortalProvider * update copy and split out example * use styles from RAC examples --------- Co-authored-by: Robert Snow <rsnow@adobe.com> * feat: Add escapeKeyBehavior to GridList/ListBox/Menu/Table/Tree (adobe#7974) * Add disallowClearAll to Menu/ListBox so Autocomplete in Popover can close without clearing selection * add support for diallowClearAll to grid/tree/table * make sure RSP components also surface disallowClearAll * update api naming to escapeKeyBehavior * skip 17 tests for build, investigate later * review comments * fix: useMove broken by NODE_ENV check (adobe#8046) * fix: ColorWheel track click (adobe#8049) * fix: minor typo in CalendarDate docs (adobe#8043) * fix: minor typo in CalendarDate docs * fix second example as well --------- Co-authored-by: Robert Snow <snowystinger@gmail.com> * fix: Updating collection when items change parents (adobe#8052) * export Autocomplete from S2 (adobe#8050) * chore: Optimize table test performance (adobe#8051) * chore: Update typescript to 5.8 (adobe#7888) * chore: update typescript to 5.8 * fix all the types for the upgrade * fix numberfield styles * fix: Apply touch-action by default in usePress (adobe#8047) * fix: Apply touch-action by default in usePress * fix test --------- Co-authored-by: Daniel Lu <dl1644@gmail.com> * fix: set some better flex behaviour (adobe#8048) * fix: Support React 19 and remove Jest reliance in test utils (adobe#7686) * attempt to get rid of jest calls in menu util * update RSP testing docs to directly mention mocks that maybe needed * bump versions of RTL to 16 * use alternative to calling jest run timers in menu option selection * fixing types and properly testing long press * fix lint * revert to pre testing library bump for clean slate * fix build and another submenu edge case now we shouldnt need to call runAllTimers after selectOption * fix react 16 bug * update return type of advanceTimer and docs copy * move some general fixes from selectionMode="replace" branch here * get rid of unneeded async * getting rid of extraneous dep * fix lint * chore: revert ts update (adobe#8060) * fix: add static color to s2 notification badge (adobe#8055) * fix: add static color to s2 notification badge * make opaque * updates * use locale * fix lint --------- Co-authored-by: Robert Snow <rsnow@adobe.com> * chore: Latest translations (adobe#8036) * Latest translations * Translation correction * Couple of translation corrections * Remove å from Norwegian string --------- Co-authored-by: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> * fix: Relax Parcel version range in public plugins (adobe#8067) * Disclosure button label size update to match new sizes from Specturm (adobe#8006) Co-authored-by: Danni <darobins@adobe.com> * chore: audit 3.41 (adobe#8064) * chore: audit 3.41 * remove deprecation * chore: audit 3.41 (adobe#8064) * chore: audit 3.41 * remove deprecation * chore: Update package dependencies for @react-aria/overlays and @react-aria-components * Added @react-aria/ssr and updated @react-aria/overlays in @react-aria/overlays package.json * Added @react-aria/overlays, @react-aria/ssr, and @react-aria/utils in @react-aria-components package.json * chore: Update import paths and dependencies for @react-aria-nutrient * Refactored import statements in various components and tests to use @react-aria-nutrient/overlays instead of @react-aria/overlays. * Removed references to @react-aria/overlays from package.json and yarn.lock. * Updated documentation links to reflect the new package structure. * chore: Update import paths in TableTests to use @react-aria-nutrient * Refactored import statements in TableTests.js to replace @react-aria with @react-aria-nutrient for live-announcer, utils, and focus modules. * Ensured consistency with recent package structure changes. * fix: Add missing newline at end of test files * Ensured proper formatting by adding a newline at the end of Table.test.js and TestTableUtils.test.tsx files to comply with best practices. --------- Co-authored-by: Daniel Lu <dl1644@gmail.com> Co-authored-by: Trevor Howell <25328178+ToyWalrus@users.noreply.github.com> Co-authored-by: Robert Snow <rsnow@adobe.com> Co-authored-by: Devon Govett <devongovett@gmail.com> Co-authored-by: DarkstarXDD <108657985+DarkstarXDD@users.noreply.github.com> Co-authored-by: Robert Snow <snowystinger@gmail.com> Co-authored-by: Reid Barber <reid@reidbarber.com> Co-authored-by: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> Co-authored-by: Richard Geraghty <rgeraght@adobe.com> Co-authored-by: Kyle Taborski <ktabors@yahoo.com> Co-authored-by: Danni <darobins@adobe.com>
ritz078
added a commit
to PSPDFKit-labs/react-spectrum
that referenced
this pull request
Apr 10, 2025
* chore: Fix generated code sample for S2 TooltipTrigger docs (adobe#8000) * Fix generated code sample for S2 TooltipTrigger docs * review * inlining * fix: export SortDescriptor type from S2 (adobe#8030) * chore: Deprecate UNSTABLE_portalContainer in favor for PortalProvider (adobe#7976) * Initial refactor to tear out UNSTABLE_portalContainer in favor of the PortalContainer * yarn.lock update * switch to deprecating UNSTABLE_portalContainer * prefer deprecated prop over context to make this a non-breaking change * add rough docs * updating copy to include explaination of UNSTABLE * rename to UNSAFE_PortalProvider * update copy and split out example * use styles from RAC examples --------- Co-authored-by: Robert Snow <rsnow@adobe.com> * feat: Add escapeKeyBehavior to GridList/ListBox/Menu/Table/Tree (adobe#7974) * Add disallowClearAll to Menu/ListBox so Autocomplete in Popover can close without clearing selection * add support for diallowClearAll to grid/tree/table * make sure RSP components also surface disallowClearAll * update api naming to escapeKeyBehavior * skip 17 tests for build, investigate later * review comments * fix: useMove broken by NODE_ENV check (adobe#8046) * fix: ColorWheel track click (adobe#8049) * fix: minor typo in CalendarDate docs (adobe#8043) * fix: minor typo in CalendarDate docs * fix second example as well --------- Co-authored-by: Robert Snow <snowystinger@gmail.com> * fix: Updating collection when items change parents (adobe#8052) * export Autocomplete from S2 (adobe#8050) * chore: Optimize table test performance (adobe#8051) * chore: Update typescript to 5.8 (adobe#7888) * chore: update typescript to 5.8 * fix all the types for the upgrade * fix numberfield styles * fix: Apply touch-action by default in usePress (adobe#8047) * fix: Apply touch-action by default in usePress * fix test --------- Co-authored-by: Daniel Lu <dl1644@gmail.com> * fix: set some better flex behaviour (adobe#8048) * fix: Support React 19 and remove Jest reliance in test utils (adobe#7686) * attempt to get rid of jest calls in menu util * update RSP testing docs to directly mention mocks that maybe needed * bump versions of RTL to 16 * use alternative to calling jest run timers in menu option selection * fixing types and properly testing long press * fix lint * revert to pre testing library bump for clean slate * fix build and another submenu edge case now we shouldnt need to call runAllTimers after selectOption * fix react 16 bug * update return type of advanceTimer and docs copy * move some general fixes from selectionMode="replace" branch here * get rid of unneeded async * getting rid of extraneous dep * fix lint * chore: revert ts update (adobe#8060) * fix: add static color to s2 notification badge (adobe#8055) * fix: add static color to s2 notification badge * make opaque * updates * use locale * fix lint --------- Co-authored-by: Robert Snow <rsnow@adobe.com> * chore: Latest translations (adobe#8036) * Latest translations * Translation correction * Couple of translation corrections * Remove å from Norwegian string --------- Co-authored-by: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> * fix: Relax Parcel version range in public plugins (adobe#8067) * Disclosure button label size update to match new sizes from Specturm (adobe#8006) Co-authored-by: Danni <darobins@adobe.com> * chore: audit 3.41 (adobe#8064) * chore: audit 3.41 * remove deprecation * chore: audit 3.41 (adobe#8064) * chore: audit 3.41 * remove deprecation * chore: Update package dependencies for @react-aria/overlays and @react-aria-components * Added @react-aria/ssr and updated @react-aria/overlays in @react-aria/overlays package.json * Added @react-aria/overlays, @react-aria/ssr, and @react-aria/utils in @react-aria-components package.json * chore: Update import paths and dependencies for @react-aria-nutrient * Refactored import statements in various components and tests to use @react-aria-nutrient/overlays instead of @react-aria/overlays. * Removed references to @react-aria/overlays from package.json and yarn.lock. * Updated documentation links to reflect the new package structure. * chore: Update import paths in TableTests to use @react-aria-nutrient * Refactored import statements in TableTests.js to replace @react-aria with @react-aria-nutrient for live-announcer, utils, and focus modules. * Ensured consistency with recent package structure changes. * fix: Add missing newline at end of test files * Ensured proper formatting by adding a newline at the end of Table.test.js and TestTableUtils.test.tsx files to comply with best practices. --------- Co-authored-by: Daniel Lu <dl1644@gmail.com> Co-authored-by: Trevor Howell <25328178+ToyWalrus@users.noreply.github.com> Co-authored-by: Robert Snow <rsnow@adobe.com> Co-authored-by: Devon Govett <devongovett@gmail.com> Co-authored-by: DarkstarXDD <108657985+DarkstarXDD@users.noreply.github.com> Co-authored-by: Robert Snow <snowystinger@gmail.com> Co-authored-by: Reid Barber <reid@reidbarber.com> Co-authored-by: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> Co-authored-by: Richard Geraghty <rgeraght@adobe.com> Co-authored-by: Kyle Taborski <ktabors@yahoo.com> Co-authored-by: Danni <darobins@adobe.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Broken by #7905. Clicking on items in the Autocomplete shell example story should move them to the "Recents" section.
The problem was due to order of operations: the
dirtyNodes
contained two separate elements representing the same node: one that was removed and another that was added. We need to process the removes first so that the node remains in the collection if it was only moved to another parent.