mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-16 19:08:27 +01:00
Fix dropdown tree search
Was constantly re-setting search term & dropdown
This commit is contained in:
parent
0cb09698a1
commit
28db39c18e
@ -225,7 +225,7 @@ export class Et2TreeDropdown extends SearchMixin<Constructor<any> & Et2InputWidg
|
|||||||
super.startSearch();
|
super.startSearch();
|
||||||
|
|
||||||
// Show the dropdown, that's where the results will go
|
// Show the dropdown, that's where the results will go
|
||||||
this.show();
|
this.open = true;
|
||||||
|
|
||||||
// Hide the tree
|
// Hide the tree
|
||||||
this.treeOrSearch = "search";
|
this.treeOrSearch = "search";
|
||||||
@ -253,8 +253,8 @@ export class Et2TreeDropdown extends SearchMixin<Constructor<any> & Et2InputWidg
|
|||||||
|
|
||||||
if(this.multiple && typeof this.value !== "undefined")
|
if(this.multiple && typeof this.value !== "undefined")
|
||||||
{
|
{
|
||||||
// Add in the new result(s)
|
// Add in the new result(s), no duplicates
|
||||||
(<string[]>this.value).splice(this.value.length, 0, ...this.selectedResults.map(el => el.value));
|
this.value = [...new Set([...this.value, ...this.selectedResults.map(el => el.value)])];
|
||||||
}
|
}
|
||||||
else if(typeof this.value !== "undefined")
|
else if(typeof this.value !== "undefined")
|
||||||
{
|
{
|
||||||
@ -351,12 +351,10 @@ export class Et2TreeDropdown extends SearchMixin<Constructor<any> & Et2InputWidg
|
|||||||
this.hasFocus = true;
|
this.hasFocus = true;
|
||||||
// Should not be needed, but not firing the update
|
// Should not be needed, but not firing the update
|
||||||
this.requestUpdate("hasFocus");
|
this.requestUpdate("hasFocus");
|
||||||
this.hide();
|
|
||||||
|
|
||||||
// Reset tags to not take focus
|
// Reset tags to not take focus
|
||||||
this.setCurrentTag(null);
|
this.setCurrentTag(null);
|
||||||
|
|
||||||
this._searchNode.setSelectionRange(this._searchNode.value.length, this._searchNode.value.length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSearchKeyDown(event)
|
handleSearchKeyDown(event)
|
||||||
|
Loading…
Reference in New Issue
Block a user