Skip to content
Snippets Groups Projects
Commit 3bab522f authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3116 OZG-3397 Un-focus search INPUT field

parent c8dd7a6b
Branches
Tags
No related merge requests found
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
*/ */
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { MatIcon } from '@angular/material/icon';
import { MatLegacyAutocompleteModule as MatAutocompleteModule } from '@angular/material/legacy-autocomplete'; import { MatLegacyAutocompleteModule as MatAutocompleteModule } from '@angular/material/legacy-autocomplete';
import { MatLegacyButton as MatButton } from '@angular/material/legacy-button'; import { MatLegacyButton as MatButton } from '@angular/material/legacy-button';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field'; import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatIcon } from '@angular/material/icon';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input'; import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
...@@ -175,6 +175,14 @@ describe('VorgangSearchComponent', () => { ...@@ -175,6 +175,14 @@ describe('VorgangSearchComponent', () => {
expect(submitSpy).toHaveBeenCalled(); expect(submitSpy).toHaveBeenCalled();
}); });
it('should remove focus from search INPUT', () => {
component.blur = jest.fn();
component.submit();
expect(component.blur).toHaveBeenCalled();
})
}); });
describe('focusIn', () => { describe('focusIn', () => {
......
...@@ -54,9 +54,14 @@ export class VorgangSearchComponent { ...@@ -54,9 +54,14 @@ export class VorgangSearchComponent {
this.searchInput.nativeElement.focus(); this.searchInput.nativeElement.focus();
} }
blur(): void {
this.searchInput.nativeElement.blur();
}
submit(): void { submit(): void {
this.previouslyEnteredSearchValue = this.formService.getValue(); this.previouslyEnteredSearchValue = this.formService.getValue();
this.formService.submit(); this.formService.submit();
this.blur();
} }
focusIn(): void { focusIn(): void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment