]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix enter key was prevented 253/head
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Fri, 11 Mar 2022 16:11:35 +0000 (08:11 -0800)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Fri, 11 Mar 2022 16:11:35 +0000 (08:11 -0800)
src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts
src-ui/src/app/components/common/input/date/date.component.ts

index fecac367b179a12e6bf5a8173388eccc4dcbd2e7..70d02540c1111337c0609ab7ce60eafe9ab4490a 100644 (file)
@@ -122,7 +122,7 @@ export class DateDropdownComponent implements OnInit, OnDestroy {
 
   // prevent chars other than numbers and separators
   onKeyPress(event: KeyboardEvent) {
-    if (!/[0-9,\.\/-]+/.test(event.key)) {
+    if ('Enter' !== event.key && !/[0-9,\.\/-]+/.test(event.key)) {
       event.preventDefault()
     }
   }
index 709f96e7586cc439d6230365de4e054aace6b6ed..251ba9c98d9fd931c9796859e83a78614d6127ef 100644 (file)
@@ -29,7 +29,7 @@ export class DateComponent extends AbstractInputComponent<string> implements OnI
 
   // prevent chars other than numbers and separators
   onKeyPress(event: KeyboardEvent) {
-    if (!/[0-9,\.\/-]+/.test(event.key)) {
+    if ('Enter' !== event.key && !/[0-9,\.\/-]+/.test(event.key)) {
       event.preventDefault()
     }
   }