mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-30 00:40:24 +01:00
[#7726] don't clear date input on invalid value while still typing
This commit is contained in:
1 parent
8d60b928fc
commit
21dd105d9a
8 files changed
+18
-7
No files matched your search
@@ -26,6 +26,15 @@ export function input(props) {
|
||||
required: () => props.field.required,
|
||||
value: () => app.utils.toDatetimeLocalInputValue(props.record[props.field.name]),
|
||||
onchange: (e) => {
|
||||
// don't clear until blur
|
||||
// https://github.com/pocketbase/pocketbase/issues/7726
|
||||
if (!e.target.value) {
|
||||
return;
|
||||
}
|
||||
props.record[props.field.name] = app.utils.toRFC3339Datetime(e.target.value);
|
||||
},
|
||||
onblur: (e) => {
|
||||
props.record[props.field.name] = null; // change to an invalid value to force reactive update
|
||||
props.record[props.field.name] = app.utils.toRFC3339Datetime(e.target.value);
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user