From 18c88d19392bdc3176951ce98e2d47cb1ae4c0a3 Mon Sep 17 00:00:00 2001 From: Barney Laurance Date: Fri, 13 Oct 2023 18:13:17 +0100 Subject: [PATCH] =?UTF-8?q?DON-909:=20Allow=20tip=20amounts=20with=20only?= =?UTF-8?q?=20one=20decimal,=20e.g.=2012.5=20for=20=C2=A312.50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When this field is set from code we may end up with just one decimal here, which would be invalid previously. --- .../donation-start-form/donation-start-form.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/donation-start/donation-start-form/donation-start-form.component.ts b/src/app/donation-start/donation-start-form/donation-start-form.component.ts index 5f39c2f17..bf11497a2 100644 --- a/src/app/donation-start/donation-start-form/donation-start-form.component.ts +++ b/src/app/donation-start/donation-start-form/donation-start-form.component.ts @@ -1848,7 +1848,7 @@ export class DonationStartFormComponent implements AfterContentChecked, AfterCon // We allow spaces at start and end of amount inputs because people can easily paste them in // by mistake, and they don't do any harm. Maxlength in the HTML makes sure there can't be so much as // to stop the number being visible. - Validators.pattern('^\\s*[£$]?[0-9]+?(\\.[0-9]{2})?\\s*$'), + Validators.pattern('^\\s*[£$]?[0-9]+?(\\.[0-9]{1,2})?\\s*$'), getCurrencyMaxValidator(), ]); }