Skip to content

Commit

Permalink
fix(showcase): adapt showcase for the braking change
Browse files Browse the repository at this point in the history
When press Enter key now the search is trigger
Braking Change:
The Components
implementing
`StarkSearchFormComponent` must implement `submitEvent`
In the component template in
the <form > tag
`(ngSubmit)="submitEvent.next()" and add `<button [hidden]="true"
type="submit"></button>`
ISSUES CLOSED: #3116
  • Loading branch information
mhenkens committed Sep 19, 2022
1 parent 2412d6a commit 16f85f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { StarkActionBarModule } from "../../../action-bar";
})
class TestSearchFormComponent implements StarkSearchFormComponent<any> {
public searchForm: FormGroup = new FormGroup({});
public readonly submitEvent: EventEmitter<void> = new EventEmitter<void>();
public workingCopyChanged = new EventEmitter<any>();

public createSearchForm(_searchCriteria: any): FormGroup {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form fxLayout="row wrap" [formGroup]="searchForm">
<form fxLayout="row wrap" [formGroup]="searchForm" (ngSubmit)="submitEvent.next()">
<!-- Year -->
<div fxFlex>
<mat-form-field>
Expand Down Expand Up @@ -27,4 +27,6 @@
<mat-option *ngFor="let option of movieOptions; trackBy: trackItemFn" [value]="option">{{ option }}</mat-option>
</mat-autocomplete>
</div>

<button [hidden]="true" type="submit">&nbsp;</button>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class DemoGenericSearchFormComponent implements OnInit, StarkSearchFormCo
@Output()
public readonly workingCopyChanged = new EventEmitter<HeroMovieSearchCriteria>();

@Output()
public readonly submitEvent: EventEmitter<void> = new EventEmitter<void>();

public yearOptions: number[] = [];
public heroOptions: string[] = [];
public movieOptions: string[] = [];
Expand Down

0 comments on commit 16f85f6

Please sign in to comment.