Skip to content

Commit

Permalink
try fix for value not updated on selectedmeasure
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Dec 10, 2023
1 parent ee486ce commit 8f42e14
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/statistics/bot-statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BotStats extends LitElement {
loading: { type: Boolean, value: true },
alertMessage: { type: String },
statistics: { type: Object },
selectedMeasure: { type: Object, state: true },
selectedMeasure: { type: Object, state: true , value: null},
successModelLoaded: { type: Boolean, state: true },
};
configModal = null;
Expand Down Expand Up @@ -335,6 +335,7 @@ class BotStats extends LitElement {
option.classList.add("list-group-item");
option.innerText = measureName;
list.appendChild(option);
option.style.cursor = "pointer";
option.addEventListener("click", () => {
this.openVisualization(measureName);
});
Expand All @@ -347,11 +348,18 @@ class BotStats extends LitElement {
);
this.selectedMeasure = measure;
this.visualizationModal.show();
// detect changes
document
.querySelector("#visualizationModal")
.addEventListener("hidden.bs.modal", () => {
this.selectedMeasure = null;
});
.querySelector("measure-visualization")
.requestUpdate("measure");
setTimeout(() => {
document
.querySelector("#visualizationModal")
.addEventListener("hidden.bs.modal", () => {
this.selectedMeasure = null;
});
});
}

filterList(input) {
Expand Down

0 comments on commit 8f42e14

Please sign in to comment.