@platned/ui 0.9.2 → 0.9.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/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7090,11 +7090,20 @@ function FullscreenSurface({
|
|
|
7090
7090
|
className
|
|
7091
7091
|
}) {
|
|
7092
7092
|
const [node, setNode] = (0, import_react50.useState)(null);
|
|
7093
|
+
const [returnFocusTo] = (0, import_react50.useState)(
|
|
7094
|
+
() => typeof document === "undefined" ? null : document.activeElement
|
|
7095
|
+
);
|
|
7093
7096
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_radix_ui9.Dialog.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_radix_ui9.Dialog.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
7094
7097
|
import_radix_ui9.Dialog.Content,
|
|
7095
7098
|
{
|
|
7096
7099
|
ref: setNode,
|
|
7097
7100
|
"aria-describedby": void 0,
|
|
7101
|
+
onCloseAutoFocus: (event) => {
|
|
7102
|
+
if (returnFocusTo?.isConnected && returnFocusTo !== document.body) {
|
|
7103
|
+
event.preventDefault();
|
|
7104
|
+
returnFocusTo.focus();
|
|
7105
|
+
}
|
|
7106
|
+
},
|
|
7098
7107
|
onEscapeKeyDown: (event) => void deferEscapeToInnerPopup(event),
|
|
7099
7108
|
className: cn(
|
|
7100
7109
|
"fixed inset-0 overflow-auto bg-default-secondary p-4 focus:outline-none lg:p-6",
|