Preserve focus inside grid editors

This commit is contained in:
Julian Appel 2026-07-29 11:02:30 +02:00
parent 096ba8aa1c
commit 1b2ca84258
3 changed files with 33 additions and 1 deletions

View file

@ -230,6 +230,18 @@ export function formatPhaseTypeLabel(value: string): string {
return value;
}
export function isGridEditorControlTarget(target: unknown): boolean {
if (
target === null ||
typeof target !== "object" ||
!("closest" in target) ||
typeof target.closest !== "function"
) {
return false;
}
return Boolean(target.closest("input, select, textarea"));
}
export function parseNumeric(cellKey: CellKey, draft: string): number | undefined {
const trimmed = draft.trim();
if (trimmed === "") {