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() { isUnstyled() {
return this.unstyled !== undefined ? this.unstyled : this.$primevueConfig?.unstyled; 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() { $theme() {
return this.$primevueConfig?.theme; return this.$primevueConfig?.theme;
}, },

View File

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

View File

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