diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index 8009574255..8c3855f028 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -789,9 +789,15 @@ export const Et2WithSearchMixin = >(superclass async _handleSearchBlur(event : FocusEvent) { clearTimeout(this._searchTimeout); - if(event.relatedTarget && this !== (event.relatedTarget).parentElement) + if(event.relatedTarget && this !== (event.relatedTarget).parentElement || event.relatedTarget === null) { + // Try any value they had in progress + if(this._searchInputNode.value && this.allowFreeEntries) + { + this.createFreeEntry(this._searchInputNode.value); + } await this.dropdown.hide(); + this.clearSearch(); if(event.relatedTarget && event.relatedTarget !== this) { event.relatedTarget.focus();