Prevent excess option addition

This commit is contained in:
Iván Ovejero 2021-09-09 19:32:10 +02:00
parent 3045c0de1e
commit 19afcdbcfd

View file

@ -5,7 +5,7 @@
</div>
<div v-for="property in getProperties" :key="property.name" class="fixed-collection-parameter-property">
<div v-if="property.displayName === ''"></div>
<div v-if="property.displayName === '' || parameter.options.length === 1"></div>
<div v-else class="parameter-name" :title="property.displayName">{{property.displayName}}:</div>
<div v-if="multipleValues === true">
@ -80,9 +80,16 @@ export default mixins(genericHelpers)
};
},
mounted() {
const sectionKeys = Object.keys(this.values);
if (
sectionKeys.length === 0 ||
(sectionKeys.length === 1 && this.values[sectionKeys[0]].length === 0)
) {
this.$nextTick(function () {
this.optionSelected(this.parameter.options[0].name);
});
}
},
computed: {
getPlaceholderText (): string {