Skip to content

Commit

Permalink
Fix default values of snapToEnd and snapToStart in ScrollViewProps
Browse files Browse the repository at this point in the history
Summary:
Changelog: [internal]

Default value for `snapToEnd` and `snapToStart` was incorrect in Fabric. This makes no practical difference as default value is never used (JavaScript always sets true or false).

Default value of `snapToEnd` is true.
https://reactnative.dev/docs/scrollview#snaptoend

Default value of `snapToStart` is true.
https://reactnative.dev/docs/scrollview#snaptostart

Reviewed By: PeteTheHeat

Differential Revision: D27505377

fbshipit-source-id: 73e88aa6ad13a851b8c401e9716fc9a650ec0098
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Apr 1, 2021
1 parent e42ffdd commit 0901830
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,13 @@ ScrollViewProps::ScrollViewProps(
"snapToOffsets",
sourceProps.snapToOffsets,
{})),
snapToStart(
convertRawProp(rawProps, "snapToStart", sourceProps.snapToStart, {})),
snapToStart(convertRawProp(
rawProps,
"snapToStart",
sourceProps.snapToStart,
true)),
snapToEnd(
convertRawProp(rawProps, "snapToEnd", sourceProps.snapToEnd, {})),
convertRawProp(rawProps, "snapToEnd", sourceProps.snapToEnd, true)),
contentInsetAdjustmentBehavior(convertRawProp(
rawProps,
"contentInsetAdjustmentBehavior",
Expand Down

0 comments on commit 0901830

Please sign in to comment.