Skip to content

Commit

Permalink
Allow user to finish typing date before formatting
Browse files Browse the repository at this point in the history
Debounce `onExpirationChange` to avoid calling `formatDateToString`
on invalid on uncompletely inputed date strings.

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
  • Loading branch information
Fenn-CS committed Dec 11, 2023
1 parent c179408 commit 04e8733
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04e8733

Please sign in to comment.