react-native-ui-lib 8.3.2-snapshot.7740 → 8.3.2-snapshot.7741
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -33,11 +33,15 @@ const ExpandableOverlay = (props, ref) => {
|
|
|
33
33
|
setExpandableVisible(true);
|
|
34
34
|
onPress?.(props);
|
|
35
35
|
}, [onPress, customValue]);
|
|
36
|
-
const
|
|
36
|
+
const dismissOverlay = useCallback(() => {
|
|
37
37
|
setExpandableVisible(false);
|
|
38
38
|
focusAccessibility();
|
|
39
|
+
}, [focusAccessibility]);
|
|
40
|
+
const closeExpandable = useCallback(() => {
|
|
41
|
+
dismissOverlay();
|
|
39
42
|
useDialog ? dialogProps?.onDismiss?.() : modalProps?.onDismiss?.();
|
|
40
|
-
|
|
43
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
+
}, [dismissOverlay, dialogProps?.onDismiss, modalProps?.onDismiss]);
|
|
41
45
|
const toggleExpandable = useCallback(() => visible ? closeExpandable() : openExpandable(), [visible, openExpandable, closeExpandable]);
|
|
42
46
|
useImperativeHandle(ref, () => ({
|
|
43
47
|
openExpandable,
|
|
@@ -45,7 +49,7 @@ const ExpandableOverlay = (props, ref) => {
|
|
|
45
49
|
toggleExpandable
|
|
46
50
|
}));
|
|
47
51
|
const renderModal = () => {
|
|
48
|
-
return <Modal testID={`${testID}.overlay`} overlayBackgroundColor={Colors.$backgroundDefault} {...modalProps} visible={visible} onDismiss={
|
|
52
|
+
return <Modal testID={`${testID}.overlay`} overlayBackgroundColor={Colors.$backgroundDefault} {...modalProps} visible={visible} onDismiss={dismissOverlay} onRequestClose={closeExpandable} onBackgroundPress={closeExpandable}>
|
|
49
53
|
{showTopBar && <Modal.TopBar onDone={closeExpandable} {...topBarProps} />}
|
|
50
54
|
{expandableContent}
|
|
51
55
|
</Modal>;
|