fix(core): update

This commit is contained in:
Philipp Kunz 2023-10-07 19:33:04 +02:00
parent 50e591b80c
commit 46652dec6f
2 changed files with 6 additions and 7 deletions

View File

@ -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'
}

View File

@ -603,7 +603,8 @@ export class DeesTable<T> 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<T> 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<T> extends DeesElement {
});
// Replace the cell's content with the input
target.innerHTML = '';
target.appendChild(input);
input.focus();
}