-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Description
I'm submitting a ... (check one with "x")
[x] bug report => search github for a similar issue or PR before submitting
Current behavior
I've been pulling my hair out over this issue for quite some time, and I think I've finally nailed it down: A form that has a <input>
control wrapped in a <fieldset>
and that fieldset is disabled after submit throws a ExpressionChangedAfterItHasBeenCheckedError
whenever the form is submitted using the keyboard (and only the keyboard). The error does not appear when the user uses the mouse to submit the form.
Expected behavior
Angular should not throw a ExpressionChangedAfterItHasBeenCheckedError
in the following repro.
Minimal reproduction of the problem with instructions
http://plnkr.co/edit/lp3bZobyXWEsqVEuuSty
- run the plunkr in a separate window, open dev tools (JS console)
- focus the plunkr run window and press
tab
once to put focus on username field - enter any email address and hit
enter
to submit the form - JS console shows
ExpressionChangedAfterItHasBeenCheckedError
Step 4 does not occur if you click "Login" (= form submit button) with the mouse in step 3.
Unfortunately, angular 4 stack traces and debugging in and around that issue were not helpful as I could not get any idea which binding is causing this issue. "Luckily" I did experience the same error when I was still on angular 2 and the stacktraces there pointed me towards
at Wrapper_NgControlStatusGroup.checkHost (/InternalFormsSharedModule/NgControlStatusGroup/wrapper.ngfactory.js:33)
Looking at this, I assume the issue is somewhere in the forms module....
What is the motivation / use case for changing the behavior?
Errors are never good.
Please tell us about your environment:
- Angular version: 2.0.X
@angular/cli: 1.0.0
node: 6.10.1
os: darwin x64
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/core: 4.0.2
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2
@angular/router: 4.0.2
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.2
-
Browser: [Chrome 57.0.2987.133 (64-bit)]
Only tested in chrome -
Language: [all | TypeScript X.X | ES6/7 | ES5]
TypeScript 2.1