Skip to content

Commit

Permalink
Fixed: Save button will enable when any change happen in the modal(#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sourabh committed May 1, 2024
1 parent 685d6b3 commit 0bbbeea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/AddStaffMemberModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</ion-content>

<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button @click="saveParties">
<ion-fab-button :disabled="!isRoleUpdated()" @click="saveParties">
<ion-icon :icon="saveOutline" />
</ion-fab-button>
</ion-fab>
Expand Down Expand Up @@ -223,7 +223,13 @@ export default defineComponent({
},
getPartyRoleTypeId(partyId: string) {
return this.getParty(partyId) ? this.getParty(partyId).roleTypeId : ''
}
},
isRoleUpdated() {
return this.parties.some((party: any) => {
const selectedParty = this.selectedPartyValues.find((p: any) => p.partyId === party.partyId);
return selectedParty?.roleTypeId !== party.roleTypeId;
});
},
},
async mounted() {
await this.findParties()
Expand Down

0 comments on commit 0bbbeea

Please sign in to comment.