Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: generic-search - conflict with ngxFormErrors + form not submitted when press Enter key #3116

Open
SuperITMan opened this issue Nov 29, 2021 · 0 comments · May be fixed by #3459
Open

ui: generic-search - conflict with ngxFormErrors + form not submitted when press Enter key #3116

SuperITMan opened this issue Nov 29, 2021 · 0 comments · May be fixed by #3459
Assignees
Labels
Projects
Milestone

Comments

@SuperITMan
Copy link
Member

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

Using ngxFormErrors with generic-search component throws the error:

Error: Transition Rejection($id: 3 type: 6, message: The transition errored, detail: Error: StaticInjectorError(AppModule)[MatInput -> FormGroupDirective]: StaticInjectorError(Platform: core)[MatInput -> FormGroupDirective]: NullInjectorError: No provider for FormGroupDirective!)

The solution to this issue is to add the form tag in the html template of the form component

<form [formGroup]="searchForm">
  <!-- form component content -->
</form>

Due to this, the "submit" behavior is broken and pressing Enter key does not submit the form as it should.

Expected behavior

The form should be submitted when pressing Enter key.

Minimal reproduction of the problem with instructions

Use <mat-error ngxFormErrors="<form-control-name>"> in search-form component template used with generic-search

What is the motivation / use case for changing the behavior?

Environment


Angular version: 7.x
Stark version: 10.x


Others:

@SuperITMan SuperITMan added this to the 10.2.4 milestone Nov 29, 2021
@SuperITMan SuperITMan added this to To do in 10.2.0 via automation Nov 29, 2021
@SuperITMan SuperITMan modified the milestones: 10.2.4, 10.2.5 Dec 14, 2021
@mhenkens mhenkens self-assigned this Sep 14, 2022
mhenkens added a commit to mhenkens/stark that referenced this issue Sep 14, 2022
When press Enter key now the search is trigger

ISSUES CLOSED: NationalBankBelgium#3116
@mhenkens mhenkens linked a pull request Sep 14, 2022 that will close this issue
3 tasks
mhenkens added a commit to mhenkens/stark that referenced this issue Sep 15, 2022
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: NationalBankBelgium#3116
mhenkens added a commit to mhenkens/stark that referenced this issue Sep 15, 2022
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: NationalBankBelgium#3116
@SuperITMan SuperITMan modified the milestones: 10.2.5, 10.2.6 Sep 15, 2022
mhenkens added a commit to mhenkens/stark that referenced this issue Sep 19, 2022
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: NationalBankBelgium#3116
mhenkens added a commit to mhenkens/stark that referenced this issue Sep 19, 2022
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: NationalBankBelgium#3116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
10.2.0
  
To do
Development

Successfully merging a pull request may close this issue.

2 participants