fix(core): update
This commit is contained in:
parent
50e591b80c
commit
46652dec6f
@ -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'
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user