diff --git a/terminus-ui/select/src/select.component.html b/terminus-ui/select/src/select.component.html index 9a501c86e..da4501baa 100644 --- a/terminus-ui/select/src/select.component.html +++ b/terminus-ui/select/src/select.component.html @@ -81,6 +81,7 @@ [(ngModel)]="searchQuery" (ngModelChange)="querySubject.next(searchQuery)" (blur)="handleInputBlur($event)" + (keydown)="$event.stopPropagation()" #input /> diff --git a/terminus-ui/select/src/select.component.spec.ts b/terminus-ui/select/src/select.component.spec.ts index bf757ec8b..2a3ba16ad 100644 --- a/terminus-ui/select/src/select.component.spec.ts +++ b/terminus-ui/select/src/select.component.spec.ts @@ -1095,6 +1095,7 @@ describe(`TsSelectComponent`, function() { const fixture = createComponent(testComponents.AutocompleteAllowMultipleNoReopen); fixture.detectChanges(); + const element = getSelectElement(fixture); const input = getAutocompleteInput(fixture); typeInElement('fl', input); fixture.detectChanges(); @@ -1102,12 +1103,12 @@ describe(`TsSelectComponent`, function() { expect(input.value).toEqual('fl'); // move down to Florida and try to select it - dispatchKeyboardEvent(input, 'keydown', DOWN_ARROW); - dispatchKeyboardEvent(input, 'keydown', DOWN_ARROW); - dispatchKeyboardEvent(input, 'keydown', DOWN_ARROW); - dispatchKeyboardEvent(input, 'keydown', DOWN_ARROW); - dispatchKeyboardEvent(input, 'keydown', DOWN_ARROW); - dispatchKeyboardEvent(input, 'keydown', ENTER); + dispatchKeyboardEvent(element, 'keydown', DOWN_ARROW); + dispatchKeyboardEvent(element, 'keydown', DOWN_ARROW); + dispatchKeyboardEvent(element, 'keydown', DOWN_ARROW); + dispatchKeyboardEvent(element, 'keydown', DOWN_ARROW); + dispatchKeyboardEvent(element, 'keydown', DOWN_ARROW); + dispatchKeyboardEvent(element, 'keydown', ENTER); fixture.detectChanges(); expect(input.value).toEqual('');