-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Description
Hi, I'm trying to use a slider animation, a button should slide when pressed and the pointer moves but when I press the button, the button state change and onStateChanged is triggered with the pressed state and then instantly after that it is triggered again with the un-pressed state as if I have put my finger up even though I still have my finger on the screen and didn't started to move.
Provide a Repro
import { useRef } from "react"
import { View } from "react-native"
import Rive, { RiveRef } from "rive-react-native"
export const TestRiveScreen = () => {
const riveRef = useRef<RiveRef>(null)
return (
<View style={{ justifyContent: "center" }}>
<Rive
ref={riveRef}
resourceName="test_slider"
stateMachineName="Slider Machine"
autoplay={true}
onRiveEventReceived={(event) => {
console.log("event", event)
}}
onStateChanged={(machine, name) => {
console.log(machine, name)
}}
style={{ width: "100%", height: 400 }}
/>
</View>
)
}
Source .riv
/.rev
file
https://rive.app/community/4409-9028-slider-example/
Expected behavior
The button should slide with the finger and the button un-pressed state should not trigger if my finger is still pressed in
Device & Versions (please complete the following information)
- Device: [Android Emulator]
- OS: [Android]
- NPM Version: [8.19.3]
Additional context
The same code with the same animation works fine on iOS
weihanyau, RomualdPercereau and zispidd
Metadata
Metadata
Assignees
Labels
No labels