mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-31 11:09:04 +01:00
Fix link-to would close & clear immediately after selecting a result
This commit is contained in:
parent
d5f56b8bae
commit
124b6b1f96
@ -358,6 +358,8 @@ export class Et2LinkTo extends Et2InputWidget(ScopedElementsMixin(FormControlMix
|
||||
|
||||
// Clear link entry
|
||||
this.select.value = {app: this.select.app, id: ""};
|
||||
this.select._searchNode.clearSearch();
|
||||
this.select._searchNode.select_options = [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -284,7 +284,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
// Fixes missing empty label
|
||||
this.select?.requestUpdate("value");
|
||||
// Fixes incorrect opening position
|
||||
this.select?.popup.handleAnchorChange();
|
||||
this.select?.popup?.handleAnchorChange();
|
||||
});
|
||||
}
|
||||
|
||||
@ -581,6 +581,12 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
|
||||
protected handleValueChange(e : SlChangeEvent)
|
||||
{
|
||||
// Only interested when selected value changes, not any nested inputs
|
||||
if(e.target !== this.select)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const old_value = this.__value;
|
||||
this.__value = Array.isArray(this.select.value) ?
|
||||
this.select.value.map(e => e.replaceAll("___", " ")) :
|
||||
|
@ -456,6 +456,7 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
||||
@keydown=${this._handleSearchKeyDown}
|
||||
@blur=${this._handleSearchBlur}
|
||||
@sl-clear=${this._handleSearchClear}
|
||||
@sl-change=${this._handleSearchChange}
|
||||
></et2-textbox>
|
||||
${edit}
|
||||
</div>
|
||||
@ -613,7 +614,7 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
||||
this.remoteSearch(newValueElement, this.searchOptions).then((result : SelectOption[]) =>
|
||||
{
|
||||
const option = <SelectOption>result.find(o => o.value == newValueElement);
|
||||
if(option)
|
||||
if(option && !this._selected_remote.some(o => o.value == newValueElement))
|
||||
{
|
||||
this._selected_remote.push(option);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user