forked from jappel/leistungsbilanz-ts
Preserve focus inside grid editors
This commit is contained in:
parent
096ba8aa1c
commit
1b2ca84258
3 changed files with 33 additions and 1 deletions
|
|
@ -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 === "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue