fix: use default value from schema for non inheritable fields (#2513)

Eg. moreControl
This commit is contained in:
Yohan Boniface 2025-02-14 17:17:15 +01:00 committed by GitHub
commit c00de1a457
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,10 +81,14 @@ class BaseElement {
} }
get() { get() {
if (!this.properties.inheritable) return this.builder.getter(this.field) let value
const path = this.field.split('.') const path = this.field.split('.')
const key = path[path.length - 1] 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 if (value === undefined) return SCHEMA[key]?.default
return value return value
} }