diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 35cd471..5f694d4 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@design.estate/dees-catalog', - version: '1.0.217', + version: '1.0.218', description: 'website for lossless.com' } diff --git a/ts_web/elements/dees-table.ts b/ts_web/elements/dees-table.ts index b768b65..e11ada3 100644 --- a/ts_web/elements/dees-table.ts +++ b/ts_web/elements/dees-table.ts @@ -603,7 +603,8 @@ export class DeesTable extends DeesElement { return actions; } - handleCellEditing(event: Event, itemArg: T, key: string) { + async handleCellEditing(event: Event, itemArg: T, key: string) { + const domtools = await this.domtoolsPromise; const target = event.target as HTMLElement; const transformedItem = this.displayFunction(itemArg); const initialValue = (transformedItem[key] as unknown as string) || ''; @@ -612,16 +613,15 @@ export class DeesTable extends DeesElement { input.type = 'text'; input.value = initialValue; - const blurInput = (blurArg = true, saveArg = false) => { + const blurInput = async (blurArg = true, saveArg = false) => { if (blurArg) { input.blur(); } if (saveArg) { itemArg[key] = input.value as any; // Convert string to T (you might need better type casting depending on your data structure) - target.innerHTML = input.value; // Update the cell's display - } else { - target.innerHTML = initialValue; } + input.remove(); + this.requestUpdate(); }; // When the input loses focus or the Enter key is pressed, update the data @@ -635,7 +635,6 @@ export class DeesTable extends DeesElement { }); // Replace the cell's content with the input - target.innerHTML = ''; target.appendChild(input); input.focus(); }