Skip to content

Commit 96f5ac4

Browse files
author
rhamlett_microsoft
committed
fixed side panel visibility issue
1 parent 4e527d2 commit 96f5ac4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/PerfProblemSimulator/wwwroot/js/dashboard.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,16 @@ function initializeSidePanel() {
935935
btnClose.addEventListener('click', closeSidePanel);
936936
}
937937

938+
// Close panel when clicking outside (on main content)
939+
document.addEventListener('click', (e) => {
940+
if (sidePanel.classList.contains('open')) {
941+
// Check if click is outside the panel and not on the toggle button
942+
if (!sidePanel.contains(e.target) && !btnToggle.contains(e.target)) {
943+
closeSidePanel();
944+
}
945+
}
946+
});
947+
938948
// Close panel on Escape key
939949
document.addEventListener('keydown', (e) => {
940950
if (e.key === 'Escape' && sidePanel.classList.contains('open')) {

0 commit comments

Comments
 (0)