Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Setting the value of a number input to a negative value using MatInputHarness.setValue sets the value to the opposite (positive) on the form control bound to the input.
Seems related to #19314
Reproduction
Steps to reproduce:
- use a mat-form-field with formControl
- in the test, set a negative value using the MatInputHarness.setValue('-3')
- formControl value will be positive (3), while MatInputHarness.getValue() will return the correct negative value (-3)
https://stackblitz.com/edit/angular-13-starter-x-3avuxy?file=src%2Fapp%2Fapp.component.spec.ts (run ng test)
Expected Behavior
Form control value should be set to a negative value
Actual Behavior
Form control value is set to a positive value
Environment
- Angular: ~13.1.0
- CDK/Material: ^13.1.1