question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to select interactable area?

See original GitHub issue

My situations is this: image

I would like to make card which have two snapping points: closed and opened. I would also like to drag the card only from the red area. But at the moment I am facing problem where my Card component is wrapped in Interactable.View and the Card moves nicely but no matter where I drag it, it moves. This is not decired.

So basically I would like to move the whole card but drag would be enable only from the red area 😃 For example the white are of the card has ListView which I can’t scroll at the moment

Let me know if you want more details 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
ButtersHubcommented, Nov 11, 2018

Actually, it should work now both on Android & iOS, in this case the white area should be some scrollable container that will get touchEvent priority over the InteractableView.

For example:

const Screen = {
    width: Dimensions.get('window').width,
    height: Dimensions.get('window').height - 75
};


export default class SwipeableCardWithScrollView extends Component {
    render() {
        return (
            <View style={styles.container}>
                <Interactable.View
                    key="third"
                    verticalOnly={true}
                    initialPosition={{x: 0, y: Screen.height/2+100}}
                    snapPoints={[
                        {y: Screen.height/2+100, damping: 0.7},
                        {y: Screen.height/2-300, damping: 0.7}
                    ]}>
                    <View style={styles.card}/>
                    <ScrollView style={styles.card1}/>
                </Interactable.View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: 'white',
    },
    card: {
        width: 300,
        height: 200,
        backgroundColor: '#ffcccc',
        borderRadius: 0
    },

    card1: {
        width: 300,
        height: 200,
        minHeight: 200,
        backgroundColor: '#5d9de4',
        borderWidth: 0,
    }
});

The result would be :

swipeablecardwithscrollview

1reaction
rotemmizcommented, Nov 11, 2018

I am closing the issue as a part of an effort to cleanup and revive the project. If this issue persists after v1.0.0, you are more than welcome to reintroduce it.

Thanks for your contribution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enum InteractableSelectMode | XR Interaction Toolkit | 2.0.4
Allows the Interactable to only be selected by a single Interactor at a time and allows other Interactors to take selection by automatically ......
Read more >
Customizing Interactables in XR Interaction Toolkit - Unity Learn
In this tutorial, you'll learn how to customize Interactables with Interactor Events to trigger events, such as cutscenes or animations.
Read more >
Unity XR Interaction ToolKit (How To Interact With UI In Virtual ...
I received many questions about how to interact with UI elements in Virtual Reality and today I am happy to bring you a...
Read more >
Unity3d new UI: How to set button's interactable zone bigger ...
I need it because the image is small and it's difficult to touch it on the mobile device. So I need to have...
Read more >
Interactable - MRTK 2 - Microsoft Learn
Multi-Dimension selection mode is used to create sequential buttons, or a button that has more than two steps, like controlling speed with three ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found