feat: improve terminal scrollbar and pane focus handling
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const INTERACTIVE_TARGET_SELECTOR = [
|
||||
"a",
|
||||
"button",
|
||||
"input",
|
||||
"select",
|
||||
"textarea",
|
||||
"[role='button']",
|
||||
"[role='link']",
|
||||
"[contenteditable='true']",
|
||||
"[data-paseo-pane-focus-exempt='true']",
|
||||
].join(", ");
|
||||
|
||||
export function shouldFocusPaneFromEventTarget(target: EventTarget | null): boolean {
|
||||
const candidate = target as unknown as { closest?: (selector: string) => Element | null } | null;
|
||||
if (!candidate || typeof candidate.closest !== "function") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return !candidate.closest(INTERACTIVE_TARGET_SELECTOR);
|
||||
}
|
||||
Reference in New Issue
Block a user