Преглед изворни кода

fix BottomSheet shaking

master
Bettenbuk Zoltan пре 5 година
родитељ
комит
245eb89b85
1 измењених фајлова са 12 додато и 8 уклоњено
  1. 12
    8
      react/features/base/dialog/components/native/BottomSheet.js

+ 12
- 8
react/features/base/dialog/components/native/BottomSheet.js Прегледај датотеку

@@ -61,11 +61,7 @@ class BottomSheet extends PureComponent<Props> {
61 61
                             styles.sheetItemContainer,
62 62
                             _styles.sheet
63 63
                         ] }>
64
-                        <ScrollView
65
-                            bounces = { false }
66
-                            showsVerticalScrollIndicator = { false }>
67
-                            { this._getWrappedContent() }
68
-                        </ScrollView>
64
+                        { this._getWrappedContent() }
69 65
                     </View>
70 66
                 </View>
71 67
             </SlidingView>
@@ -73,24 +69,32 @@ class BottomSheet extends PureComponent<Props> {
73 69
     }
74 70
 
75 71
     /**
76
-     * Wraps the content when needed (iOS 11 and above), or just returns the original children.
72
+     * Wraps the content when needed (iOS 11 and above), or just returns the original content.
77 73
      *
78 74
      * @returns {React$Element}
79 75
      */
80 76
     _getWrappedContent() {
77
+        const content = (
78
+            <ScrollView
79
+                bounces = { false }
80
+                showsVerticalScrollIndicator = { false } >
81
+                { this.props.children }
82
+            </ScrollView>
83
+        );
84
+
81 85
         if (Platform.OS === 'ios') {
82 86
             const majorVersionIOS = parseInt(Platform.Version, 10);
83 87
 
84 88
             if (majorVersionIOS > 10) {
85 89
                 return (
86 90
                     <SafeAreaView>
87
-                        { this.props.children }
91
+                        { content }
88 92
                     </SafeAreaView>
89 93
                 );
90 94
             }
91 95
         }
92 96
 
93
-        return this.props.children;
97
+        return content;
94 98
     }
95 99
 }
96 100
 

Loading…
Откажи
Сачувај