also looking at this
fix(native): preserve modal presentation protocol properties
#2099
3 files
+41
-2
| @@ -13,7 +13,7 @@ const NATIVE_PROP_NAMES = [ | ||
| 13 | 13 | 'keyboardVerticalOffset', 'keyExtractor', 'listRole', 'maxLength', 'maximumDate', 'maximumTrackTintColor', 'maximumValue', |
| 14 | 14 | 'maxToRenderPerBatch', 'minimumDate', 'minimumTrackTintColor', 'minimumValue', 'minuteInterval', 'numberOfLines', |
| 15 | 15 | 'numColumns', 'onEndReachedThreshold', 'pagingEnabled', 'passwordRules', 'placeholderTextColor', 'pointerEvents', |
| 16 | 'presentationStyle', | |
| 16 | 'presentationStyle', 'nonModal', 'dismissOnOutsideTap', | |
| 17 | 17 | 'pressRetentionOffset', 'progressBackgroundColor', 'progressViewOffset', 'refreshControl', 'resizeMode', |
| 18 | 18 | 'returnKeyType', 'scrollEnabled', 'scrollTarget', 'secureTextEntry', 'selectedValue', 'selectionColor', |
| 19 | 19 | 'showsHorizontalScrollIndicator', 'showsVerticalScrollIndicator', 'statusBarTranslucent', |
| @@ -36,7 +36,7 @@ export const NATIVE_BOOLEAN_PROPS = new Set([ | ||
| 36 | 36 | 'animating', 'autoCorrect', 'autoFocus', 'autoplay', 'autoPlay', 'bounces', 'controls', 'disabled', |
| 37 | 37 | 'editable', 'hidesWhenStopped', 'horizontal', 'loop', 'multiline', 'muted', 'pagingEnabled', 'paused', |
| 38 | 38 | 'refreshing', 'scrollEnabled', 'secureTextEntry', 'selectTextOnFocus', 'showsHorizontalScrollIndicator', |
| 39 | 'showsVerticalScrollIndicator', 'transparent', 'visible', | |
| 39 | 'showsVerticalScrollIndicator', 'transparent', 'visible', 'nonModal', 'dismissOnOutsideTap', | |
| 40 | 40 | 'fitToBounds', 'showsUserLocation', 'zoomEnabled', 'rotateEnabled', 'pitchEnabled', 'showsCompass', 'showsScale', |
| 41 | 41 | 'pictureInPicture', |
| 42 | 42 | ]) |
| @@ -227,6 +227,15 @@ describe('events', () => { | ||
| 227 | 227 | }) |
| 228 | 228 | }) |
| 229 | 229 | |
| 230 | it.each(['nonModal dismissOnOutsideTap', 'non-modal dismiss-on-outside-tap'])('preserves native popup boolean protocol names: %s', async (attributes) => { | |
| 231 | const { root } = await translateHtmlToIR(`<div data-native="Modal" ${attributes}></div>`) | |
| 232 | expect(root.props).toMatchObject({ nonModal: true, dismissOnOutsideTap: true }) | |
| 233 | expect(root.props.nonmodal).toBeUndefined() | |
| 234 | expect(root.props.dismissonoutsidetap).toBeUndefined() | |
| 235 | const { root: blocking } = await translateHtmlToIR('<div data-native="Modal" nonModal="false" dismissOnOutsideTap="false"></div>') | |
| 236 | expect(blocking.props).toMatchObject({ nonModal: false, dismissOnOutsideTap: false }) | |
| 237 | }) | |
| 238 | ||
| 230 | 239 | it('decodes JSON object props forwarded by native components', async () => { |
| 231 | 240 | const { root } = await translateHtmlToIR('<div data-native="ScrollView" contentContainerStyle="{"paddingTop":12}"></div>') |
| 232 | 241 | |