Skip to content
Snippets Groups Projects
Unverified Commit e6acf526 authored by Sean Tsai's avatar Sean Tsai Committed by GitHub
Browse files

Fix clicking enter will create empty transaction (#1316)

fix #1301

After the change, upper components will not detect the press enter event
before the datepicker is closed.
parent 4c9dbcb9
No related branches found
No related tags found
No related merge requests found
......@@ -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 || {};
......
---
category: Bugfix
authors: [aleetsaiya]
---
Fix clicking enter will create empty transaction issue.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment