mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
fix crash when enter is used to submit empty date in date picker (#5423)
This commit is contained in:
@@ -346,11 +346,13 @@ export function DateSelect({
|
||||
onUpdate?.(defaultValue);
|
||||
}
|
||||
} else if (shouldSaveFromKey(e)) {
|
||||
setValue(selectedValue);
|
||||
setOpen(false);
|
||||
if (selectedValue) {
|
||||
setValue(selectedValue);
|
||||
const date = parse(selectedValue, dateFormat, new Date());
|
||||
onSelect(format(date, 'yyyy-MM-dd'));
|
||||
}
|
||||
|
||||
const date = parse(selectedValue, dateFormat, new Date());
|
||||
onSelect(format(date, 'yyyy-MM-dd'));
|
||||
setOpen(false);
|
||||
|
||||
if (open && e.key === 'Enter') {
|
||||
// This stops the event from propagating up
|
||||
|
||||
6
upcoming-release-notes/5423.md
Normal file
6
upcoming-release-notes/5423.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [Serializator]
|
||||
---
|
||||
|
||||
Fix crash when the enter key is used to submit an empty date to the date picker
|
||||
Reference in New Issue
Block a user