You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks to @Yrobot, we now have a new prop for the component preventDefault. This is a small but great addition to the component - something which I had been wanting as well.
preventDefault={true} turns off the default story behaviour, i.e. it does not attach event listeners for hold to press, tap on the right and left for navigating between stories. This opens up a lot of possibilities other than just turning off the default behaviour. After turning this off, you can create interactive stories that can listen to user interactions like clicks, swipes, etc - very much similar to how you have polls on Instagram. Each renderer already receives action prop to control the play state, and hence a combination of preventDefault=true and action can be used to add interaction in stories. You will have more control over navigation now, if you plan to implement complex scenarios like these.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks to @Yrobot, we now have a new prop for the component
preventDefault
. This is a small but great addition to the component - something which I had been wanting as well.preventDefault={true}
turns off the default story behaviour, i.e. it does not attach event listeners for hold to press, tap on the right and left for navigating between stories. This opens up a lot of possibilities other than just turning off the default behaviour. After turning this off, you can create interactive stories that can listen to user interactions like clicks, swipes, etc - very much similar to how you have polls on Instagram. Each renderer already receivesaction
prop to control the play state, and hence a combination ofpreventDefault=true
andaction
can be used to add interaction in stories. You will have more control over navigation now, if you plan to implement complex scenarios like these.This is now available in
v2.3.0
.Beta Was this translation helpful? Give feedback.
All reactions