Skip to content

A local-first personal finance app

Fix clicking enter will create empty transaction (#1316)

Sean Tsaie6acf526385e
diff --git a/packages/desktop-client/src/components/select/DateSelect.js b/packages/desktop-client/src/components/select/DateSelect.js
index e60af0a7a7..2cd6ef0d6a 100644
--- a/packages/desktop-client/src/components/select/DateSelect.js
+++ b/packages/desktop-client/src/components/select/DateSelect.js
@@ -263,12 +263,10 @@ export default function DateSelect({
let date = d.parse(selectedValue, dateFormat, new Date());
onSelect(d.format(date, 'yyyy-MM-dd'));
- if (open) {
- if (userSelectedValue.current !== selectedValue) {
- // This stops the event from propagating up
- e.stopPropagation();
- e.preventDefault();
- }
+ if (open && e.key === 'Enter') {
+ // This stops the event from propagating up
+ e.stopPropagation();
+ e.preventDefault();
}
let { onKeyDown } = inputProps || {};
diff --git a/upcoming-release-notes/1316.md b/upcoming-release-notes/1316.md
new file mode 100644
index 0000000000..bf34331652
--- /dev/null
+++ b/upcoming-release-notes/1316.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [aleetsaiya]
+---
+
+Fix clicking enter will create empty transaction issue.