mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-09 15:00:07 +01:00
Et2Select: Add tabindex to options to avoid focus stealing in sidemenu, other event handling cleanup
This commit is contained in:
parent
f15cbd186f
commit
5601b99c97
@ -576,7 +576,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
|||||||
{
|
{
|
||||||
super.et2HandleBlur(event);
|
super.et2HandleBlur(event);
|
||||||
}
|
}
|
||||||
this.dropdown?.hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -834,6 +833,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
|||||||
?clearable=${this.clearable}
|
?clearable=${this.clearable}
|
||||||
?required=${this.required}
|
?required=${this.required}
|
||||||
helpText=${this.helpText}
|
helpText=${this.helpText}
|
||||||
|
tabindex="0"
|
||||||
hoist
|
hoist
|
||||||
placement=${this.placement}
|
placement=${this.placement}
|
||||||
.getTag=${this._tagTemplate}
|
.getTag=${this._tagTemplate}
|
||||||
|
@ -147,7 +147,7 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([search][multiple]) sl-select[open]::part(expand-icon) {
|
:host([search]) sl-select[open]::part(expand-icon) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,6 +398,7 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
// One of the key properties has changed, need to add the needed nodes
|
// One of the key properties has changed, need to add the needed nodes
|
||||||
if(changedProperties.has("search") || changedProperties.has("editModeEnabled") || changedProperties.has("allowFreeEntries"))
|
if(changedProperties.has("search") || changedProperties.has("editModeEnabled") || changedProperties.has("allowFreeEntries"))
|
||||||
{
|
{
|
||||||
|
this._unbindListeners();
|
||||||
// Missing any of the required attributes? Now we need to take it out.
|
// Missing any of the required attributes? Now we need to take it out.
|
||||||
if(!this.searchEnabled && !this.editModeEnabled && !this.allowFreeEntries || this.readonly)
|
if(!this.searchEnabled && !this.editModeEnabled && !this.allowFreeEntries || this.readonly)
|
||||||
{
|
{
|
||||||
@ -405,8 +406,8 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normally this should be handled in render(), but we have to add our nodes in
|
// Listeners may have been skipped from connectedCallback()
|
||||||
//this._addNodes();
|
this._bindListeners();
|
||||||
}
|
}
|
||||||
// Update any tags if edit mode changes
|
// Update any tags if edit mode changes
|
||||||
if(changedProperties.has("editModeEnabled") || changedProperties.has("readonly"))
|
if(changedProperties.has("editModeEnabled") || changedProperties.has("readonly"))
|
||||||
@ -417,6 +418,11 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
tag.editable = this.editModeEnabled && !this.readonly;
|
tag.editable = this.editModeEnabled && !this.readonly;
|
||||||
tag.removable = !this.readonly;
|
tag.removable = !this.readonly;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(this.readonly)
|
||||||
|
{
|
||||||
|
this._unbindListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user