diff --git a/api/js/etemplate/Et2Select/Et2SelectEmail.ts b/api/js/etemplate/Et2Select/Et2SelectEmail.ts index d7265a5f43..b11669bf03 100644 --- a/api/js/etemplate/Et2Select/Et2SelectEmail.ts +++ b/api/js/etemplate/Et2Select/Et2SelectEmail.ts @@ -115,6 +115,24 @@ export class Et2SelectEmail extends Et2Select }); } + /** + * Handle keypresses inside the search input + * Overridden from parent to also skip the hidden selected options, which other selects do not do + * + * @param {KeyboardEvent} event + * @protected + */ + protected _handleSearchKeyDown(event : KeyboardEvent) + { + // Pass off some keys to select + if(['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) + { + // Strip out hidden non-matching selected so key navigation works + this.menuItems = this.menuItems.filter(i => !i.checked); + } + return super._handleSearchKeyDown(event); + } + /** * Actually query the server. *