Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new stackingOrder prop to Sortable components that allows reversing the z-index stacking order of items. By default, items use ascending order (higher index = higher z-index), but with stackingOrder='desc', items with lower indices are rendered above items with higher indices.
Changes:
- Added
ItemsStackingOrdertype with 'asc' and 'desc' values - Implemented z-index calculation logic in
useItemZIndexhook to support descending order - Added
stackingOrderprop to shared props with 'asc' as the default value
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-sortables/src/types/props/shared.ts | Added ItemsStackingOrder type definition and stackingOrder prop to SharedProps |
| packages/react-native-sortables/src/types/providers/shared.ts | Added isStackingOrderDesc boolean to context type |
| packages/react-native-sortables/src/providers/shared/hooks/useItemZIndex.ts | Updated z-index calculation to support descending order |
| packages/react-native-sortables/src/providers/shared/CommonValuesProvider.ts | Added stackingOrder prop and computed isStackingOrderDesc value |
| packages/react-native-sortables/src/providers/shared/SharedProvider.tsx | Added stackingOrder to required props list |
| packages/react-native-sortables/src/constants/props.ts | Added default value 'asc' for stackingOrder |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/react-native-sortables/src/providers/shared/hooks/useItemZIndex.ts
Outdated
Show resolved
Hide resolved
…ItemZIndex.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
9c213ad to
a94bc07
Compare
This file contains hidden or 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
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.
Description
This PR adds a possibility to reverse items stacking order (render items with lower index below items with higher index).
Changes showcase
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-01-13.at.19.36.46.mp4
Example source code