Skip to content

Press feedback is delayed #24

@sabaturgay

Description

@sabaturgay

I have a screen using ScrollView from react-native-gesture-handler.
Inside it, I’m rendering a pressable created with createAnimatedPressable:

const AnimatedPressable = createAnimatedPressable((progress) => {
	'worklet'
	return {
		opacity: interpolate(progress, [0, 1], [1, 0.5]),
		transform: [{ scale: interpolate(progress, [0, 1], [1, 0.95]) }],
		elevation: IS_ANDROID ? 0 : interpolate(progress, [0, 1], [204, 74]),
	}
})

The problem: press feedback is noticeably delayed.
When I tap the component, opacity + scale don’t react immediately.
There’s roughly a ~20ms pause before the animation starts.

This only happens when the component is inside an RNGH ScrollView. Maybe this is intentional, to make a delay to decide whether the interaction is a scroll or a tap before sending the press event, so the animation can’t start right away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions