Skip to content

Commit 32496ba

Browse files
committed
chore: unify debounce timing for input handling across multiple components
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 1104a7c commit 32496ba

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/components/Questions/AnswerInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default {
174174
// As data instead of method, to have a separate debounce per AnswerInput
175175
this.debounceOnInput = debounce((event) => {
176176
return this.queue.add(() => this.onInput(event))
177-
}, 500)
177+
}, 400)
178178
},
179179
180180
methods: {

src/mixins/QuestionMixin.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export default {
214214
onTitleChange: debounce(function (text) {
215215
this.$emit('update:text', text)
216216
this.saveQuestionProperty('text', text)
217-
}, 200),
217+
}, 400),
218218

219219
/**
220220
* Forward the description change to the parent and store to db
@@ -224,7 +224,7 @@ export default {
224224
onDescriptionChange: debounce(function (description) {
225225
this.$emit('update:description', description)
226226
this.saveQuestionProperty('description', description)
227-
}, 200),
227+
}, 400),
228228

229229
/**
230230
* Forward the required change to the parent and store to db
@@ -234,7 +234,7 @@ export default {
234234
onRequiredChange: debounce(function (isRequiredValue) {
235235
this.$emit('update:isRequired', isRequiredValue)
236236
this.saveQuestionProperty('isRequired', isRequiredValue)
237-
}, 200),
237+
}, 400),
238238

239239
/**
240240
* Create mapper to forward the required change to the parent and store to db
@@ -247,7 +247,7 @@ export default {
247247
const newExtraSettings = { ...this.extraSettings, ...newSettings }
248248
this.$emit('update:extraSettings', newExtraSettings)
249249
this.saveQuestionProperty('extraSettings', newExtraSettings)
250-
}, 200),
250+
}, 400),
251251

252252
/**
253253
* Forward the technical-name change to the parent and store to db
@@ -257,7 +257,7 @@ export default {
257257
onNameChange: debounce(function (name) {
258258
this.$emit('update:name', name)
259259
this.saveQuestionProperty('name', name)
260-
}, 200),
260+
}, 400),
261261

262262
/**
263263
* Forward the required change to the parent and store to db

src/mixins/QuestionMultipleMixin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default defineComponent({
8282
* Debounced function to save options order
8383
*/
8484
onOptionsReordered() {
85-
return debounce(this.saveOptionsOrder, 750)
85+
return debounce(this.saveOptionsOrder, 400)
8686
},
8787
},
8888

src/mixins/UserSearchMixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676
*/
7777
debounceGetSuggestions: debounce(function (...args) {
7878
this.getSuggestions(...args)
79-
}, 300),
79+
}, 400),
8080

8181
/**
8282
* Get suggestions

src/views/Create.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ export default {
367367
*/
368368
saveTitle: debounce(async function () {
369369
this.saveFormProperty('title')
370-
}, 200),
370+
}, 400),
371371
saveDescription: debounce(async function () {
372372
this.saveFormProperty('description')
373-
}, 200),
373+
}, 400),
374374
375375
/**
376376
* Add a new question to the current form

0 commit comments

Comments
 (0)