mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-09 00:16:23 +08:00
merge old config
This commit is contained in:
@@ -73,8 +73,10 @@ export function Modal({ id, open, title, children, banner, busy, wide, role = "d
|
|||||||
};
|
};
|
||||||
document.addEventListener("keydown", onKey);
|
document.addEventListener("keydown", onKey);
|
||||||
const focusFrame = requestAnimationFrame(() => {
|
const focusFrame = requestAnimationFrame(() => {
|
||||||
const target = initialFocus === "submit" ? submitButton.current : focusableElements(dialog.current!)[0];
|
const currentDialog = dialog.current;
|
||||||
(target ?? dialog.current)?.focus();
|
if (!currentDialog) return;
|
||||||
|
const target = initialFocus === "submit" ? submitButton.current : focusableElements(currentDialog)[0];
|
||||||
|
(target ?? currentDialog).focus();
|
||||||
});
|
});
|
||||||
return () => {
|
return () => {
|
||||||
cancelAnimationFrame(focusFrame);
|
cancelAnimationFrame(focusFrame);
|
||||||
|
|||||||
Reference in New Issue
Block a user