fix: Hiding of the sortable item when teleported#436
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with sortable item hiding in teleport mode by refactoring how decoration styles are applied. Instead of applying visual effects (opacity, scale, shadow) directly on the draggable view, these styles are now applied to a child element to prevent interference with position updates.
- Removes the
mergeStylesutility function and its usage throughout the codebase - Refactors decoration styles to be applied at the child level rather than merged with layout styles
- Simplifies style application by separating layout positioning from visual decoration effects
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-sortables/src/utils/styles.ts | Removes the entire mergeStyles utility function |
| packages/react-native-sortables/src/utils/index.ts | Removes export of styles utility |
| packages/react-native-sortables/src/providers/shared/hooks/useTeleportedItemStyles.ts | Removes decoration merging and simplifies teleported item positioning |
| packages/react-native-sortables/src/providers/shared/hooks/useItemLayoutStyle.ts | Refactors to focus only on layout styles, removes decoration merging |
| packages/react-native-sortables/src/providers/shared/hooks/useItemDecorationStyle.ts | Changes from returning derived values to animated styles |
| packages/react-native-sortables/src/providers/shared/hooks/index.ts | Updates exports to reflect renamed hooks |
| packages/react-native-sortables/src/components/shared/DraggableView/TeleportedItemCell.tsx | Passes through decoration props to ItemCell |
| packages/react-native-sortables/src/components/shared/DraggableView/ItemCell.tsx | Applies decoration styles to child element and updates hiding mechanism |
| packages/react-native-sortables/src/components/shared/DraggableView/DraggableView.tsx | Refactors to pass shared props and use callback for layout handling |
| example/app/src/components/items/FlexCell.tsx | Adds numberOfLines prop to prevent text overflow |
MatiPl01
pushed a commit
that referenced
this pull request
Jul 29, 2025
# [1.8.0](v1.7.1...v1.8.0) (2025-07-29) ### Bug Fixes * Allow disabling default layer provider ([#424](#424)) ([ded5c92](ded5c92)), closes [#417](#417) [#36877](https://github.com/MatiPl01/react-native-sortables/issues/36877) * Buggy grid swapping in some edge cases ([#414](#414)) ([3617f86](3617f86)) * DragProvider drag end index assignment ([#411](#411)) ([69ad8a6](69ad8a6)) * Hiding of the sortable item when teleported ([#436](#436)) ([4c3796f](4c3796f)) * Invalid flex container height on initial render and other small issues ([#437](#437)) ([48e905b](48e905b)) * Invalid ScrollView position on input focus ([#431](#431)) ([2693234](2693234)), closes [#ef4444](https://github.com/MatiPl01/react-native-sortables/issues/ef4444) * Long drop duration reordering issues ([#406](#406)) ([ace7037](ace7037)) * Multiple minor improvements ([#439](#439)) ([f9d83e3](f9d83e3)) * Paper flickering and positioning issues ([#426](#426)) ([744e291](744e291)) * Teleported active item flickering ([#405](#405)) ([1413af2](1413af2)) ### Features * Base multi zone provider ([#409](#409)) ([56f0ef3](56f0ef3)) * Base zone with event callbacks ([#413](#413)) ([e51ca61](e51ca61)) * Fixed items support in sortable flex ([#416](#416)) ([1d23fcc](1d23fcc)), closes [#374](#374) * Max overscroll settings ([#423](#423)) ([167dc4e](167dc4e)), closes [#419](#419) * Separate controlled item dimensions from measured dimensions ([#433](#433)) ([cad95e5](cad95e5)) ### Performance Improvements * Merge item decoration styles with position styles ([#407](#407)) ([5066edd](5066edd)) * More performant items reordering ([#435](#435)) ([be78141](be78141)) * Reduce the number of unnecessary onLayout calls ([#434](#434)) ([ce56159](ce56159)), closes [#431](#431) * Replace useSharedValue with useMutableValue ([#408](#408)) ([6994c7a](6994c7a))
Owner
Author
|
🎉 This issue has been resolved in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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 fixes an issue with the plain sortable item hiding in the teleport mode. It didn't work well when I applied style change on the same view as was updated via position change. Applying this hidden style on its child fixes the issue.