Skip to content

Commit 3a1e9fb

Browse files
authored
Merge branch 'main' into chore/fixing-pr-labels
2 parents 0a0c2c6 + f2d0e2d commit 3a1e9fb

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# 0.1.6 (Wed Nov 26 2025)
2+
3+
#### 🐛 Bug Fix
4+
5+
- feat: add keepVisibleAfterExiting prop to SlideAnimatedVIew [#24](https://github.com/strvcom/react-native-hero-carousel/pull/24) ([email protected])
6+
7+
#### Authors: 1
8+
9+
- Petr Konecny ([@petrkonecny2](https://github.com/petrkonecny2))
10+
11+
---
12+
13+
# 0.1.5 (Wed Nov 26 2025)
14+
15+
#### 🐛 Bug Fix
16+
17+
- fix: fixed crash when manually scrolling [#23](https://github.com/strvcom/react-native-hero-carousel/pull/23) ([email protected])
18+
19+
#### Authors: 1
20+
21+
- Petr Konecny ([@petrkonecny2](https://github.com/petrkonecny2))
22+
23+
---
24+
125
# 0.1.4 (Mon Aug 04 2025)
226

327
#### 🐛 Bug Fix

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@strv/react-native-hero-carousel",
3-
"version": "0.1.4",
3+
"version": "0.1.6",
44
"homepage": "https://github.com/strvcom/react-native-hero-carousel",
55
"description": "A customizable hero carousel component for React Native",
66
"bugs": {
@@ -73,5 +73,6 @@
7373
"publishConfig": {
7474
"access": "public"
7575
},
76-
"repository": "https://github.com/strvcom/react-native-hero-carousel"
76+
"repository": "https://github.com/strvcom/react-native-hero-carousel",
77+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
7778
}

src/components/SlideAnimatedView/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type SlideAnimatedViewProps = {
1717
enteringThreshold?: number
1818
exitingThreshold?: number
1919
style?: AnimatedProps<ViewProps>['style']
20+
keepVisibleAfterExiting?: boolean
2021
}
2122

2223
export const SlideAnimatedView = ({
@@ -26,6 +27,7 @@ export const SlideAnimatedView = ({
2627
layout,
2728
enteringThreshold = 0.99,
2829
exitingThreshold = 0.01,
30+
keepVisibleAfterExiting = false,
2931
style,
3032
}: SlideAnimatedViewProps) => {
3133
const { index, total } = useAutoCarouselSlideIndex()
@@ -56,6 +58,9 @@ export const SlideAnimatedView = ({
5658
currentValue <= exitingThreshold &&
5759
(previousValue === null || previousValue > exitingThreshold)
5860
) {
61+
if (keepVisibleAfterExiting) {
62+
return
63+
}
5964
runOnJS(setShouldShow)(false)
6065
}
6166
},

src/hooks/useManualScroll.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ export const useManualScroll = ({
1414
const scrollValue = useSharedValue(initialIndex)
1515

1616
const goToPage = useCallback(
17-
(page: number, duration = 0, animation = DEFAULT_ANIMATION) => {
17+
(page: number, duration = 0, animation?: typeof DEFAULT_ANIMATION) => {
1818
'worklet'
1919
const to = page * slideWidth
2020
if (duration) {
21-
manualScrollValue.value = { value: animation(to, duration) }
21+
manualScrollValue.value = {
22+
value: animation ? animation(to, duration) : withTiming(to, { duration }),
23+
}
2224
} else {
2325
manualScrollValue.value = { value: to }
2426
}

0 commit comments

Comments
 (0)