Update `controlled` structure in BaseEditableHolder

pull/6620/head^2
Mert Sincan 2024-10-24 14:55:53 +01:00
parent 44100af9a3
commit 2fc29287ff
3 changed files with 7 additions and 2 deletions

View File

@ -320,6 +320,11 @@ export default {
isUnstyled() {
return this.unstyled !== undefined ? this.unstyled : this.$primevueConfig?.unstyled;
},
$inProps() {
const nodePropKeys = Object.keys(this.$.vnode?.props);
return Object.fromEntries(Object.entries(this.$props).filter(([k]) => nodePropKeys?.includes(k)));
},
$theme() {
return this.$primevueConfig?.theme;
},

View File

@ -98,7 +98,7 @@ export default {
return this.d_value ?? this.$pcForm?.initialValues?.[this.$formName];
},
controlled() {
return this.defaultValue === undefined;
return this.$inProps.hasOwnProperty('modelValue') || (!this.$inProps.hasOwnProperty('modelValue') && !this.$inProps.hasOwnProperty('defaultValue'));
},
// @deprecated use $filled instead
filled() {

View File

@ -30,7 +30,7 @@
</button>
<Checkbox
v-if="checkboxMode"
:modelValue="checked"
:defaultValue="checked"
:binary="true"
:indeterminate="partialChecked"
:class="cx('nodeCheckbox')"