Skip to content

Commit

Permalink
fix: avoid initial selected task being in the menu
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Dec 12, 2023
1 parent 0ab670c commit 1f57e3a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/TaskTypeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,24 @@ export default {
},
},
watch: {
options() {
this.moveSelectedIfInMenu()
},
},
mounted() {
this.moveSelectedIfInMenu()
},
methods: {
moveSelectedIfInMenu() {
// if the initially selected value is in the dropdown, get it out
const selectedAction = this.actionTypes.find(a => a.id === this.value)
if (this.actionTypes.find(a => a.id === this.value)) {
this.onMenuTaskSelected(selectedAction)
}
},
getButtonType(taskType) {
return taskType.id === this.value
? 'primary'
Expand Down

0 comments on commit 1f57e3a

Please sign in to comment.