0

The ScrollView isUserInteractionEnabled parameter doesn't behave the same on NativeScript runtime version 5.0.0 as it did on 4.2.0 for Android.

No script files required. All you need is this XML to observe this problem:

<Page class="page" xmlns="http://www.nativescript.org/tns.xsd">
    <ActionBar title="Horizontal Scroll Bug" class="action-bar">
    </ActionBar>
    <StackLayout>
        <Label text="ScrollView's isUserInteractionEnabled property is false."
            padding="10" textWrap="true" fontSize="20" />
        <ScrollView id="horizontalScroll" orientation="horizontal" isUserInteractionEnabled="false">
            <StackLayout orientation="horizontal">
                <StackLayout backgroundColor="yellow">
                    <Label text="Box 1" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="red">
                    <Label text="Box 2" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="blue">
                    <Label text="Box 3" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="green">
                    <Label text="Box 4" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="purple">
                    <Label text="Box 5" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="orange">
                    <Label text="Box 6" padding="70" />
                </StackLayout>
            </StackLayout>
        </ScrollView>
        <Label text="Try to scroll the colored boxes above to the right and left to reveal more boxes.  You shouldn't be able to."
            padding="10" textWrap="true" fontSize="20" />
        <Label text="On Android with run time version 4.2.0 you can't, but on run time version 5.0.0 you can."
            padding="10" textWrap="true" fontSize="20" />
    </StackLayout>
</Page>

I posted the app on NativeScript playground here if you want to scan the QR code: https://play.nativescript.org/?template=play-js&id=hKrNlK

1 Answer 1

1

Disable scroll when isUserInteractionEnabled is set to false - This seems to be a behavioural change introduced in {N} 5.x. At same time I'm unsure whether this was intentional, you might want to report this at Github.

Meanwhile you may use this workaround.

Sign up to request clarification or add additional context in comments.

3 Comments

Made fixes when enable scrolling back - play.nativescript.org/?template=play-js&id=hKrNlK&v=10
Thanks for logging this issue. As an FYI, the reason I disable a scroll on a scrollview is if I have it nested in multiple things that accept gestures (e.g. a tab view with a vertical and horizontal scrollview) and I want to handle the scroll in code (e.g. buttons instead of swipe).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.