Commit 082d990c authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Fix single and multiselect interaction (coscine/issues#795)

parent 42b2bb73
......@@ -3,8 +3,7 @@
:id="cssId"
:options="selectableOptions"
v-model="selectedOptions"
:multiple="!maxMode"
:hide-selected="true"
:multiple="!noMaxMode"
label="name"
track-by="name"
:placeholder="$t('multiselectPlaceholder')"
......@@ -27,14 +26,14 @@ import { MetadataApi, defaultOnCatch } from '@coscine/api-connection';
export default Vue.extend({
name: 'InputCombobox',
beforeMount() {
this.maxMode =
this.noMaxMode =
this.checkField(
this.formFieldInformation,
'http://www.w3.org/ns/shacl#maxCount'
) &&
this.formFieldInformation['http://www.w3.org/ns/shacl#maxCount'][0][
parseInt(this.formFieldInformation['http://www.w3.org/ns/shacl#maxCount'][0][
'value'
] === 1;
]) === 1;
// set the datatype
this.$set(this.formData[this.nodeName][0], 'type', 'uri');
......@@ -73,7 +72,7 @@ export default Vue.extend({
},
data() {
return {
maxMode: false,
noMaxMode: true,
selectableOptions: [] as object[],
selectedOptions: [] as object[],
maxNumberOfSelectedObjects: 10000,
......@@ -81,7 +80,7 @@ export default Vue.extend({
},
methods: {
getMax() {
if (this.maxMode) {
if (!this.noMaxMode) {
return this.formFieldInformation[
'http://www.w3.org/ns/shacl#maxCount'
] !== undefined &&
......@@ -98,7 +97,7 @@ export default Vue.extend({
)
: this.maxNumberOfSelectedObjects;
}
return undefined;
return false;
},
input() {
const array = [];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment