Skip to content

Commit

Permalink
fix(input): previous value to number
Browse files Browse the repository at this point in the history
  • Loading branch information
aesteves60 authored and dpellier committed Nov 28, 2024
1 parent 551d5dc commit 1531f75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class OdsInput {

this.odsChange.emit({
name: this.name,
previousValue: this.isNumeric(previousValue) ? Number(previousValue) : previousValue,
previousValue: typeof this.value === 'number' && this.isNumeric(previousValue) ? Number(previousValue) : previousValue,
validity: this.internals.validity,
value: this.value,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('ods-phone-number behaviour', () => {
expect(odsChangeSpy).toHaveReceivedEventDetail({
isoCode: 'fr',
name: 'ods-phone-number',
previousValue: newValue.slice(0, -1).substring(1),
previousValue: newValue.slice(0, -1),
validity: {
badInput: false,
customError: false,
Expand Down

0 comments on commit 1531f75

Please sign in to comment.