Skip to content

Commit

Permalink
Merge pull request #426 from ProcessMaker/observation/FOUR-16817
Browse files Browse the repository at this point in the history
FOUR-16817: Implement check for MultiSelect Options
  • Loading branch information
ryancooley authored Jul 1, 2024
2 parents 03b79bb + 229aaff commit 8745096
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/FormSelectList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,22 @@ export default {
value: {
deep: true,
handler(newValue) {
if (newValue && typeof newValue === "object") {
if (newValue && typeof newValue === "object" && this.isMultiSelectDisabled()) {
this.updateOption(newValue);
}
}
}
},
methods: {
/**
* Checks if multi-select is disabled.
*
* @return {boolean} Returns true if multi-select is disabled, false otherwise.
*/
isMultiSelectDisabled() {
return this.options.allowMultiSelect === false;
},
/**
* Updates the specified option with the provided updated value.
*
Expand All @@ -259,7 +268,7 @@ export default {
* If the value is an object, it updates the selected option if necessary.
*/
onSelectListOptionsUpdated() {
if (this.value && typeof this.value === "object") {
if (this.value && typeof this.value === "object" && this.isMultiSelectDisabled()) {
this.updateOption(this.value);
}
},
Expand Down

0 comments on commit 8745096

Please sign in to comment.