Skip to content

Commit d46081a

Browse files
Improves cascade of debounce setting
1 parent f39ef63 commit d46081a

File tree

8 files changed

+97
-114
lines changed

8 files changed

+97
-114
lines changed

dist/formulate.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formulate.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formulate.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 85 additions & 107 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@braid/vue-formulate",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"description": "The easiest way to build forms in Vue.",
55
"main": "dist/formulate.umd.js",
66
"module": "dist/formulate.esm.js",
@@ -92,7 +92,7 @@
9292
"watch": "^1.0.2"
9393
},
9494
"dependencies": {
95-
"@braid/vue-formulate-i18n": "^1.14.0",
95+
"@braid/vue-formulate-i18n": "^1.15.0",
9696
"is-plain-object": "^3.0.1",
9797
"is-url": "^1.2.4",
9898
"nanoid": "^2.1.11"

src/FormulateInput.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ export default {
371371
if (this.errorBehavior === 'value' && value) {
372372
this.behavioralErrorVisibility = value
373373
}
374+
},
375+
debounce (value) {
376+
this.debounceDelay = value
374377
}
375378
},
376379
created () {

src/libs/context.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default {
1515
blurHandler: blurHandler.bind(this),
1616
classification: this.classification,
1717
component: this.component,
18+
debounceDelay: this.debounceDelay,
1819
disableErrors: this.disableErrors,
1920
errors: this.explicitErrors,
2021
formShouldShowErrors: this.formShouldShowErrors,

src/libs/registry.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ class Registry {
124124
const hasVModelValue = has(component.$options.propsData, 'formulateValue')
125125
const hasValue = has(component.$options.propsData, 'value')
126126
// This is not reactive
127-
if (this.ctx.debounce && !has(component.$options.propsData, 'debounce')) {
128-
component.debounceDelay = this.ctx.debounce
127+
const debounceDelay = this.ctx.debounce || this.ctx.debounceDelay || (this.ctx.context && this.ctx.context.debounceDelay)
128+
if (debounceDelay && !has(component.$options.propsData, 'debounce')) {
129+
component.debounceDelay = debounceDelay
129130
}
130131
if (
131132
!hasVModelValue &&

0 commit comments

Comments
 (0)