feat(scrollview): add isScrollEnabled property #6640
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add ScrollView.isScrollEnabled property that should cover the majority of the scenarios that users try to address with isUserInteractionEnabled / isEnabled properties. This is a straightforward and consistent solution that does one thing and one thing only -- enable/disable scroll.
We have a known inconsistency in Android / iOS with respect to the
isUserInteractionEnabled
property and container components (e.g. scrollview, various layouts, etc.)-- in iOS when property is set to false on the container, it disables user interaction recursively on all subviews, while on Android it doesn't. As this is the standard behavior on each OS we decided not to streamline this:isUserInteractionEnabled
false is basically equivalent toisScrollEnabled
false (if we were to streamline the behavior for scrollview to match iOS counterpart, we would have to do the same for all layout containers too so for the time being we are "consistently inconsistent" -- consistent among Android components and inconsistent betwen Android and iOS)isUserInteractionEnabled
false disables scroll and also disables user interaction for all subviews.Also, ScrollView.isEnabled property currently has no effect neither on Android, nor on iOS.
Fixes #6511
Depends on NativeScript/tns-core-modules-widgets#150 (merge after the widgets PR)