mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
fix: teach FormBuilder where to look for default values
UMap will look into the schema for default values, but untill now FormBuilder wasn't. This fix is not the real fix we want, but let's make this last until then. The real fix is to refactor schema and make obj.properties a Proxy object that will then be consumed by FormBuilder as it is now.
This commit is contained in:
parent
05c27aed98
commit
9473a8552f
1 changed files with 15 additions and 0 deletions
|
@ -1192,6 +1192,21 @@ U.FormBuilder = L.FormBuilder.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getter: function (field) {
|
||||||
|
const path = field.split('.')
|
||||||
|
let value = this.obj
|
||||||
|
let sub
|
||||||
|
for (sub of path) {
|
||||||
|
try {
|
||||||
|
value = value[sub]
|
||||||
|
} catch {
|
||||||
|
console.log(field)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (value === undefined) values = U.SCHEMA[sub]?.default
|
||||||
|
return value
|
||||||
|
},
|
||||||
|
|
||||||
finish: (event) => {
|
finish: (event) => {
|
||||||
event.helper?.input?.blur()
|
event.helper?.input?.blur()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue