fictoan-react 1.7.0 → 1.7.2
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.
|
@@ -56,7 +56,7 @@ const Drawer = React__default.forwardRef(
|
|
|
56
56
|
return shouldRender ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
57
57
|
Element,
|
|
58
58
|
{
|
|
59
|
-
as: "
|
|
59
|
+
as: "div",
|
|
60
60
|
"data-drawer": true,
|
|
61
61
|
ref: effectiveRef,
|
|
62
62
|
classNames,
|
|
@@ -15,7 +15,7 @@ const Modal = React__default.forwardRef(
|
|
|
15
15
|
description,
|
|
16
16
|
...props
|
|
17
17
|
}, ref) => {
|
|
18
|
-
const modalId =
|
|
18
|
+
const modalId = `${id}`;
|
|
19
19
|
const descriptionId = description ? `${modalId}-description` : void 0;
|
|
20
20
|
if (showBackdrop) {
|
|
21
21
|
classNames.push("show-backdrop");
|
|
@@ -63,7 +63,7 @@ const Modal = React__default.forwardRef(
|
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
const showModal = (modalId) => {
|
|
66
|
-
const modal = document.querySelector(
|
|
66
|
+
const modal = document.querySelector(`#${modalId}[data-modal]`);
|
|
67
67
|
if (modal instanceof HTMLElement) {
|
|
68
68
|
modal.showPopover();
|
|
69
69
|
const focusableElements = modal.querySelectorAll(
|
|
@@ -75,7 +75,7 @@ const showModal = (modalId) => {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
const hideModal = (modalId) => {
|
|
78
|
-
const modal = document.querySelector(
|
|
78
|
+
const modal = document.querySelector(`#${modalId}[data-modal]`);
|
|
79
79
|
if (modal instanceof HTMLElement) {
|
|
80
80
|
modal.hidePopover();
|
|
81
81
|
if (document.activeElement instanceof HTMLElement) {
|
|
@@ -84,7 +84,7 @@ const hideModal = (modalId) => {
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
const toggleModal = (modalId) => {
|
|
87
|
-
const modal = document.querySelector(
|
|
87
|
+
const modal = document.querySelector(`#${modalId}[data-modal]`);
|
|
88
88
|
if (modal instanceof HTMLElement) {
|
|
89
89
|
modal.matches(":popover-open") ? hideModal(modalId) : showModal(modalId);
|
|
90
90
|
}
|