Skip to content

Action sheet glitch when prop animated is set to false after update to V10 #482

@DaveMonGym

Description

@DaveMonGym

Action sheet glitches up and down when prop animated is set to false after update to V10

Screen_Recording_20251205_105734_Reppa.App.mp4
  • Updated to V10 to see if the gesture issues were resolved, but now new issues have come up
    I looked into it and it seems to be an issue with the value and initialValue calculation.
var moveSheetWithAnimation = React.useCallback(function (velocity, value, min, gestureEnd) {
        console.log(initialValue.current);
        var initial = value || initialValue.current;
        var minTranslate = min || minTranslateValue.current;
        if (!animated) {
            translateY.value = initial;
            // console.log('moveSheetWithAnimation to ', initial);
            return;
        }
        var config = openAnimationConfig;
        var correctedValue = initial > minTranslate ? initial : 0;
        notifyOffsetChange(correctedValue);
        if (accessibilityInfo.current.prefersCrossFadeTransitions &&
            !gestureEnd) {
            actionSheetOpacity.value = 0;
            translateY.value = initial;
            actionSheetOpacity.value = withTiming(1, {
                duration: 150,
                easing: Easing.in(Easing.ease),
            });
        }
        else {
            translateY.value = withSpring(initial, __assign(__assign({}, config), { velocity: typeof velocity !== 'number' ? undefined : velocity }));
        }
        notifySnapIndexChanged();
    }, [animated, openAnimationConfig]);

I logged the value and you can see it jump around every time I open the sheet

 LOG  546.2857360839844
 LOG  574.8571472167969
 LOG  564.5714111328125
 LOG  546.2857360839844
 LOG  574.8571472167969
 LOG  564.5714111328125

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions