From 4816bf75c01d602b344aa86399d4be744e800885 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 20 May 2022 08:12:16 -0400 Subject: [PATCH] CSR-624: add unmounted method to clear checked answers --- .../list-button-horizontal/list-button-horizontal.vue | 4 ++++ src/ux-components/list-button/list-button.vue | 4 ++++ src/ux-components/list-card/list-card.vue | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue index ccb995f77..974a965b8 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -91,6 +91,10 @@ export default { : this.selectedValues[0]; } }, + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); + }, methods: { displayLoader() { this.isLoaderDisplayed = true; diff --git a/src/ux-components/list-button/list-button.vue b/src/ux-components/list-button/list-button.vue index 1f1a5046b..e567ebaa6 100644 --- a/src/ux-components/list-button/list-button.vue +++ b/src/ux-components/list-button/list-button.vue @@ -91,6 +91,10 @@ export default { : this.selectedValues[0]; } }, + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); + }, methods: { displayLoader() { this.isLoaderDisplayed = true; diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 742ec4584..c5ed398f3 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -98,6 +98,10 @@ export default { : this.selectedValues[0]; } }, + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); + }, computed: { getLabelClasses() { if (this.isWide) {