@sb1/ffe-modals-react 0.3.2 → 0.3.3
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/es/Modal.js +3 -2
- package/lib/Modal.js +3 -2
- package/package.json +2 -2
package/es/Modal.js
CHANGED
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React, { useEffect, useImperativeHandle, useState, useRef } from 'react';
|
|
24
|
+
import { createPortal } from 'react-dom';
|
|
24
25
|
import classnames from 'classnames';
|
|
25
26
|
import { CloseButton } from './CloseButton';
|
|
26
27
|
export var Modal = React.forwardRef(function (_a, ref) {
|
|
@@ -53,7 +54,7 @@ export var Modal = React.forwardRef(function (_a, ref) {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
}, [isOpen]);
|
|
56
|
-
return (
|
|
57
|
+
return createPortal(
|
|
57
58
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
58
59
|
React.createElement("dialog", __assign({}, rest, { ref: modalRef, className: classnames('ffe-modal', className), "aria-labelledby": ariaLabelledby, onClick: function (event) {
|
|
59
60
|
var target = event.target;
|
|
@@ -67,5 +68,5 @@ export var Modal = React.forwardRef(function (_a, ref) {
|
|
|
67
68
|
} }),
|
|
68
69
|
React.createElement("div", { className: "ffe-modal__body" },
|
|
69
70
|
React.createElement(CloseButton, { onClick: function () { var _a; return (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, locale: locale }),
|
|
70
|
-
children)));
|
|
71
|
+
children)), document.body);
|
|
71
72
|
});
|
package/lib/Modal.js
CHANGED
|
@@ -50,6 +50,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
51
|
exports.Modal = void 0;
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
|
+
var react_dom_1 = require("react-dom");
|
|
53
54
|
var classnames_1 = __importDefault(require("classnames"));
|
|
54
55
|
var CloseButton_1 = require("./CloseButton");
|
|
55
56
|
exports.Modal = react_1.default.forwardRef(function (_a, ref) {
|
|
@@ -82,7 +83,7 @@ exports.Modal = react_1.default.forwardRef(function (_a, ref) {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
}, [isOpen]);
|
|
85
|
-
return (
|
|
86
|
+
return (0, react_dom_1.createPortal)(
|
|
86
87
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
87
88
|
react_1.default.createElement("dialog", __assign({}, rest, { ref: modalRef, className: (0, classnames_1.default)('ffe-modal', className), "aria-labelledby": ariaLabelledby, onClick: function (event) {
|
|
88
89
|
var target = event.target;
|
|
@@ -96,5 +97,5 @@ exports.Modal = react_1.default.forwardRef(function (_a, ref) {
|
|
|
96
97
|
} }),
|
|
97
98
|
react_1.default.createElement("div", { className: "ffe-modal__body" },
|
|
98
99
|
react_1.default.createElement(CloseButton_1.CloseButton, { onClick: function () { var _a; return (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, locale: locale }),
|
|
99
|
-
children)));
|
|
100
|
+
children)), document.body);
|
|
100
101
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-modals-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "SpareBank 1",
|
|
6
6
|
"files": [
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "9d6c8ac64616a7ac88ec366211487f59c4fcb450"
|
|
44
44
|
}
|