mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix: use default value from schema for non inheritable fields
Eg. moreControl Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
parent
52b4244333
commit
2089d3b0c6
1 changed files with 6 additions and 2 deletions
|
@ -81,10 +81,14 @@ class BaseElement {
|
|||
}
|
||||
|
||||
get() {
|
||||
if (!this.properties.inheritable) return this.builder.getter(this.field)
|
||||
let value
|
||||
const path = this.field.split('.')
|
||||
const key = path[path.length - 1]
|
||||
const value = this.obj.getOption(key)
|
||||
if (!this.properties.inheritable) {
|
||||
value = this.builder.getter(this.field)
|
||||
} else {
|
||||
value = this.obj.getOption(key)
|
||||
}
|
||||
if (value === undefined) return SCHEMA[key]?.default
|
||||
return value
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue