From 04e87337211351127cd02a0404936de8cb1b0837 Mon Sep 17 00:00:00 2001 From: fenn-cs Date: Fri, 8 Dec 2023 18:02:14 +0100 Subject: [PATCH] Allow user to finish typing date before formatting Debounce `onExpirationChange` to avoid calling `formatDateToString` on invalid on uncompletely inputed date strings. Signed-off-by: fenn-cs --- apps/files_sharing/src/mixins/SharesMixin.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 41bdf302f7a..b76b72cebe9 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -221,10 +221,9 @@ export default { * * @param {Date} date */ - onExpirationChange(date) { + onExpirationChange: debounce((date) => { this.share.expireDate = this.formatDateToString(new Date(date)) - }, - + }, 500), /** * Uncheck expire date * We need this method because @update:checked -- 2.39.5