mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:18:57 +01:00
Et2Select: Pressing tab on empty search moves focus to next element
This commit is contained in:
parent
c6485ebd4f
commit
7195ea09b2
@ -764,6 +764,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
icon:icon
|
||||
"
|
||||
class=${"search_tag " + option.classList.value}
|
||||
tabindex="-1"
|
||||
?pill=${this.pill}
|
||||
size=${this.size || "medium"}
|
||||
?removable=${!readonly}
|
||||
@ -828,7 +829,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
?clearable=${this.clearable}
|
||||
?required=${this.required}
|
||||
helpText=${this.helpText}
|
||||
tabindex="0"
|
||||
hoist
|
||||
placement=${this.placement}
|
||||
.getTag=${this._tagTemplate}
|
||||
|
@ -470,6 +470,7 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
||||
exportparts="base:search__base"
|
||||
clearable
|
||||
autocomplete="off"
|
||||
tabindex="-1"
|
||||
placeholder="${this.egw().lang("search")}"
|
||||
style="flex: 1 1 auto;"
|
||||
@keydown=${this._handleSearchKeyDown}
|
||||
@ -952,6 +953,19 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
else if(event.key == "Tab" && !this._searchInputNode.value)
|
||||
{
|
||||
// Mess with tabindexes to allow focus to easily go to next control
|
||||
const input = this.select.shadowRoot.querySelector('[tabindex="0"]');
|
||||
input.setAttribute("tabindex", "-1");
|
||||
this.updateComplete.then(() =>
|
||||
{
|
||||
// Set it back so we can get focus again later
|
||||
input.setAttribute("tabindex", "0");
|
||||
})
|
||||
// Allow to propagate
|
||||
return;
|
||||
}
|
||||
event.stopPropagation();
|
||||
|
||||
// Don't allow event to bubble or it will interact with select
|
||||
|
@ -264,7 +264,7 @@ export class Et2EmailTag extends Et2Tag
|
||||
const option = Et2EmailTag.email_cache[this.value];
|
||||
|
||||
button_or_avatar = html`
|
||||
<et2-lavatar slot="prefix" part="icon"
|
||||
<et2-lavatar slot="prefix" part="icon" tabindex="-1"
|
||||
@mousedown=${this.handleContactMouseDown}
|
||||
.size=${style.getPropertyValue("--icon-width")}
|
||||
lname=${option.lname || nothing}
|
||||
@ -279,7 +279,7 @@ export class Et2EmailTag extends Et2Tag
|
||||
// Show a button to add as new contact
|
||||
classes['tag__has_plus'] = true;
|
||||
button_or_avatar = html`
|
||||
<et2-button-icon image="add" @mousedown=${this.handleMouseDown}
|
||||
<et2-button-icon image="add" tabindex="-1" @mousedown=${this.handleMouseDown}
|
||||
label="${this.egw().lang("Add a new contact")}"
|
||||
statustext="${this.egw().lang("Add a new contact")}">
|
||||
</et2-button-icon>`;
|
||||
|
Loading…
Reference in New Issue
Block a user