@unbxd-ui/unbxd-react-components 0.2.136 → 0.2.137
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.
|
@@ -32,7 +32,8 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
32
32
|
halign = props.halign,
|
|
33
33
|
onModalStateChange = props.onModalStateChange,
|
|
34
34
|
_props$closeOnBodyCli = props.closeOnBodyClick,
|
|
35
|
-
closeOnBodyClick = _props$closeOnBodyCli === void 0 ? false : _props$closeOnBodyCli
|
|
35
|
+
closeOnBodyClick = _props$closeOnBodyCli === void 0 ? false : _props$closeOnBodyCli,
|
|
36
|
+
closeOnOutsideClick = props.closeOnOutsideClick;
|
|
36
37
|
var _useState = (0, _react.useState)(propIsOpen),
|
|
37
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
39
|
isModalOpen = _useState2[0],
|
|
@@ -88,7 +89,7 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
|
-
if (!isWithinModal) {
|
|
92
|
+
if (!isWithinModal && closeOnOutsideClick) {
|
|
92
93
|
/* outside click -> close modal */
|
|
93
94
|
changeModalState(false);
|
|
94
95
|
}
|
|
@@ -169,7 +170,8 @@ InlineModal.defaultProps = {
|
|
|
169
170
|
halign: "left",
|
|
170
171
|
activatorAction: "click",
|
|
171
172
|
// or "hover"
|
|
172
|
-
isModalOpen: false
|
|
173
|
+
isModalOpen: false,
|
|
174
|
+
closeOnOutsideClick: true
|
|
173
175
|
};
|
|
174
176
|
InlineModal.displayName = "InlineModal";
|
|
175
177
|
var _default = exports["default"] = InlineModal;
|