Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fix enter key was prevented

Michael Shamoon4e4035a86791
diff --git a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts
index fecac367b..70d02540c 100644
--- a/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts
+++ b/src-ui/src/app/components/common/date-dropdown/date-dropdown.component.ts
@@ -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()
}
}
diff --git a/src-ui/src/app/components/common/input/date/date.component.ts b/src-ui/src/app/components/common/input/date/date.component.ts
index 709f96e75..251ba9c98 100644
--- a/src-ui/src/app/components/common/input/date/date.component.ts
+++ b/src-ui/src/app/components/common/input/date/date.component.ts
@@ -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()
}
}