mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-01 01:46:16 +00:00
Fix enter key was prevented
This commit is contained in:
@@ -122,7 +122,7 @@ export class DateDropdownComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
// prevent chars other than numbers and separators
|
// prevent chars other than numbers and separators
|
||||||
onKeyPress(event: KeyboardEvent) {
|
onKeyPress(event: KeyboardEvent) {
|
||||||
if (!/[0-9,\.\/-]+/.test(event.key)) {
|
if ('Enter' !== event.key && !/[0-9,\.\/-]+/.test(event.key)) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ export class DateComponent extends AbstractInputComponent<string> implements OnI
|
|||||||
|
|
||||||
// prevent chars other than numbers and separators
|
// prevent chars other than numbers and separators
|
||||||
onKeyPress(event: KeyboardEvent) {
|
onKeyPress(event: KeyboardEvent) {
|
||||||
if (!/[0-9,\.\/-]+/.test(event.key)) {
|
if ('Enter' !== event.key && !/[0-9,\.\/-]+/.test(event.key)) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user