[#7726] don't clear date input on invalid value while still typing

This commit is contained in:
Gani Georgiev
2026-06-05 20:28:17 +03:00
parent 8d60b928fc
commit 21dd105d9a
8 changed files with 18 additions and 7 deletions
+9
View File
@@ -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);
},
}),