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

Hidden Input doesn't clear on reset. #863

Closed
BGBRWR opened this issue Feb 4, 2021 · 1 comment
Closed

Hidden Input doesn't clear on reset. #863

BGBRWR opened this issue Feb 4, 2021 · 1 comment

Comments

@BGBRWR
Copy link
Contributor

BGBRWR commented Feb 4, 2021

🐞 bug report

Description

Similar to #856. Form reset, setValue, or patchValue don't work on hiddenInputs.

🔬 Minimal Reproduction

StackBlitz below will explain to how reproduce.
https://stackblitz.com/edit/angular-h41zum?file=src/app/app.component.html

🌍 Your Environment

Angular Version:


Angular CLI: 11.0.2
Node: 14.15.0
OS: win32 x64

Angular: 11.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.2
@angular-devkit/build-angular   0.1100.2
@angular-devkit/core            11.0.2
@angular-devkit/schematics      11.0.2
@angular/cdk                    11.0.1
@angular/material               11.0.1
@schematics/angular             11.0.2
@schematics/update              0.1100.2
ng-packagr                      11.0.3
rxjs                            6.6.3
typescript                      4.0.5

Anything else relevant?

NepipenkoIgor pushed a commit that referenced this issue Mar 19, 2021
…lues (#864)

* fix(hidden-input): #706 false values won't pass hiddenInput check

* fix(hidden-input): #863 Past value that have been cleared don't haunt future values on hiddenInputs

* fix(to-number): empty string check

Empty string is no longer converted to zero.
Number('') === 0;
This was returning inconsistent values when input values were deleted.

* fix(hidden-input): form setValue without phantom values
@NepipenkoIgor
Copy link
Collaborator

@BGBRWR Thank you. Please try newest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants