Skip to content

Commit 79ae0e6

Browse files
authored
chore: add changeset for flex-based sizing gesture fix (#878)
1 parent 80a7b15 commit 79ae0e6

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
"react-native-reanimated-carousel": patch
3+
---
4+
5+
# Fix gesture blocking when using flex-based sizing
6+
7+
## Bug Fixes
8+
9+
### Gesture Blocking with `flex: 1`
10+
Fixed an issue where gestures were blocked or delayed when using `style={{ flex: 1 }}` instead of explicit `width`/`height` props.
11+
12+
**Root Cause:** Race condition between `sizeReady` (SharedValue, updates immediately on UI thread) and `size` (React state, updates asynchronously). When `sizeReady` became `true`, the React state `size` was still `0`, causing gesture handlers to incorrectly block input.
13+
14+
**Solution:** All worklet functions now use `resolvedSize.value` (SharedValue) instead of React state `size` to ensure consistent synchronization on the UI thread.
15+
16+
### itemWidth/itemHeight Not Working
17+
Fixed an issue where `itemWidth`/`itemHeight` props were being ignored - items rendered at container width instead of the specified item dimensions.
18+
19+
**Root Cause:** `ItemLayout.tsx` was prioritizing `style.width` over `itemWidth` prop.
20+
21+
**Solution:** Now correctly prioritizes explicit `itemWidth`/`itemHeight` props for item sizing.
22+
23+
## Affected Files
24+
- `src/components/ScrollViewGesture.tsx` - Fixed race condition in gesture handlers
25+
- `src/components/ItemLayout.tsx` - Fixed itemWidth/itemHeight priority

0 commit comments

Comments
 (0)