fix(dees-input-list,dees-icon): preserve input focus after list updates and make icons ignore pointer events

This commit is contained in:
2026-04-06 10:41:20 +00:00
parent a5f7a7ecee
commit b5055b0696
4 changed files with 20 additions and 13 deletions

View File

@@ -665,11 +665,13 @@ export class DeesInputList extends DeesInputBase<DeesInputList> {
this.currentCandidateIndex = -1;
this.matchingCandidates = [];
this.validationText = '';
const input = this.shadowRoot?.querySelector('.add-input') as HTMLInputElement;
if (input) { input.value = ''; input.focus(); }
this.emitChange();
// Re-focus input after Lit re-renders
this.updateComplete.then(() => {
const input = this.shadowRoot?.querySelector('.add-input') as HTMLInputElement;
if (input) { input.value = ''; input.focus(); }
});
}
/**
@@ -708,15 +710,13 @@ export class DeesInputList extends DeesInputBase<DeesInputList> {
this.value = [...this.value, trimmedValue];
this.inputValue = '';
this.validationText = '';
// Clear the input
const input = this.shadowRoot?.querySelector('.add-input') as HTMLInputElement;
if (input) {
input.value = '';
input.focus();
}
this.emitChange();
// Re-focus input after Lit re-renders
this.updateComplete.then(() => {
const input = this.shadowRoot?.querySelector('.add-input') as HTMLInputElement;
if (input) { input.value = ''; input.focus(); }
});
}
private startEdit(index: number) {

View File

@@ -338,6 +338,7 @@ export class DeesIcon extends DeesElement {
justify-content: center;
line-height: 1;
vertical-align: middle;
pointer-events: none;
}
/* Improve rendering performance */