diff --git a/Libraries/Components/ScrollView/ScrollView.windows.js b/Libraries/Components/ScrollView/ScrollView.windows.js index b7c36e688b5..001b0bee33a 100644 --- a/Libraries/Components/ScrollView/ScrollView.windows.js +++ b/Libraries/Components/ScrollView/ScrollView.windows.js @@ -485,12 +485,14 @@ const ScrollView = React.createClass({ this.props.alwaysBounceVertical !== undefined ? this.props.alwaysBounceVertical : !this.props.horizontal; + + const baseStyle = this.props.horizontal ? styles.baseHorizontal : styles.baseVertical; const props = { ...this.props, alwaysBounceHorizontal, alwaysBounceVertical, - style: ([styles.base, this.props.style]: ?Array), + style: ([baseStyle, this.props.style]: ?Array), onTouchStart: this.scrollResponderHandleTouchStart, onTouchMove: this.scrollResponderHandleTouchMove, onTouchEnd: this.scrollResponderHandleTouchEnd, @@ -557,7 +559,7 @@ const ScrollView = React.createClass({ return React.cloneElement( refreshControl, {style: props.style}, - + {contentContainer} ); @@ -572,11 +574,14 @@ const ScrollView = React.createClass({ }); const styles = StyleSheet.create({ - base: { + baseVertical: { flex: 1, }, + baseHorizontal: { + flex: 1, + flexDirection: 'row', + }, contentContainerHorizontal: { - alignSelf: 'flex-start', flexDirection: 'row', }, }); diff --git a/ReactWindows/Playground/project.json b/ReactWindows/Playground/project.json index 88b591ba76a..0eea258eb70 100644 --- a/ReactWindows/Playground/project.json +++ b/ReactWindows/Playground/project.json @@ -1,6 +1,6 @@ { "dependencies": { - "Facebook.CSSLayout": "2.0.0-pre", + "Facebook.CSSLayout": "2.0.1-pre", "Microsoft.ApplicationInsights": "1.0.0", "Microsoft.ApplicationInsights.PersistenceChannel": "1.0.0", "Microsoft.ApplicationInsights.WindowsApps": "1.0.0", diff --git a/ReactWindows/ReactNative.Tests/project.json b/ReactWindows/ReactNative.Tests/project.json index 024f1e9b081..d56a6f906ac 100644 --- a/ReactWindows/ReactNative.Tests/project.json +++ b/ReactWindows/ReactNative.Tests/project.json @@ -1,6 +1,6 @@ { "dependencies": { - "Facebook.CSSLayout": "2.0.0-pre", + "Facebook.CSSLayout": "2.0.1-pre", "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2" }, "frameworks": { diff --git a/ReactWindows/ReactNative/Views/Text/ReactSpanShadowNode.cs b/ReactWindows/ReactNative/Views/Text/ReactSpanShadowNode.cs index a3987563e0d..875be969280 100644 --- a/ReactWindows/ReactNative/Views/Text/ReactSpanShadowNode.cs +++ b/ReactWindows/ReactNative/Views/Text/ReactSpanShadowNode.cs @@ -127,5 +127,23 @@ public override void UpdateInline(Inline inline) inline.FontWeight = _fontWeight ?? FontWeights.Normal; inline.FontFamily = _fontFamily != null ? new FontFamily(_fontFamily) : FontFamily.XamlAutoFontFamily; } + + /// + /// This method will be called by once + /// per batch, before calculating layout. This will only be called for + /// nodes that are marked as updated with or + /// require layout (i.e., marked with ). + /// + public override void OnBeforeLayout() + { + // Run flexbox on the children which are inline views. + foreach (var child in this.Children) + { + if (!(child is ReactInlineShadowNode)) + { + child.CalculateLayout(); + } + } + } } } diff --git a/ReactWindows/ReactNative/Views/Text/ReactTextShadowNode.cs b/ReactWindows/ReactNative/Views/Text/ReactTextShadowNode.cs index f8c5114b2f7..826c6d1a9a1 100644 --- a/ReactWindows/ReactNative/Views/Text/ReactTextShadowNode.cs +++ b/ReactWindows/ReactNative/Views/Text/ReactTextShadowNode.cs @@ -267,5 +267,23 @@ private void UpdateTextBlockCore(RichTextBlock textBlock, bool measureOnly) 0); } } + + /// + /// This method will be called by once + /// per batch, before calculating layout. This will only be called for + /// nodes that are marked as updated with or + /// require layout (i.e., marked with ). + /// + public override void OnBeforeLayout() + { + // Run flexbox on the children which are inline views. + foreach (var child in this.Children) + { + if (!(child is ReactInlineShadowNode)) + { + child.CalculateLayout(); + } + } + } } } diff --git a/ReactWindows/ReactNative/project.json b/ReactWindows/ReactNative/project.json index 98ef0f864e3..c1a2c98c6b6 100644 --- a/ReactWindows/ReactNative/project.json +++ b/ReactWindows/ReactNative/project.json @@ -1,6 +1,6 @@ { "dependencies": { - "Facebook.CSSLayout": "2.0.0-pre", + "Facebook.CSSLayout": "2.0.1-pre", "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2", "Newtonsoft.Json": "9.0.1", "System.Reactive": "3.0.0",