angular-docs-cn/packages/forms/test
Tidi 97d6d909e7 fix(forms): number input fires valueChanges twice. (#36087)
Prior to this commit, number input fields would to fire valueChanges twice: once for `input` events when typing and second for the `change` event when the field lost focus (both events happen at once when using the increment and decrement buttons on the number field).

Fixes #12540

BREAKING CHANGE: Number inputs no longer listen to the `change` event.
* Tests which trigger `change` events need to be updated to trigger `input` events instead.
* The `change` event was in place to support IE9, as we found that `input` events were not fired with backspace or cut actions. If you need to maintain IE9 support, you will need to add a change event listener to number inputs and call the `onChange` method of `NumberValueAccessor` manually.
* Lastly, old versions of WebDriver would synthetically trigger the `change` event on `WebElement.clear` and `WebElement.sendKeys`. If you are using an old version of WebDriver, you may need to update tests to ensure `input` events are triggered. For example, you could use `element.sendKeys(Keys.chord(Keys.CONTROL, "a"), Keys.BACK_SPACE);` in place of `element.clear()`.

PR Close #12540

PR Close #36087
2020-05-07 10:20:26 -07:00
..
BUILD.bazel test: disable failing saucelabs tests (#36620) 2020-04-14 10:13:33 -07:00
directives_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_array_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_builder_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_control_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_group_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
reactive_integration_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
spies.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
template_integration_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
validators_spec.ts fix(forms): handle numeric values properly in the validator (#36157) 2020-05-05 11:50:00 -07:00
value_accessor_integration_spec.ts fix(forms): number input fires valueChanges twice. (#36087) 2020-05-07 10:20:26 -07:00