30
Views
1
Comments
Solved
Esc button closed the sidebar but fails to open sidebar thereafter
Question
Application Type
Reactive

HI Team,

There is a known issue for sidebar widget, when clicked esc button it closes that sidebar but after that if u again try to open the sidebar it won't open. I made use of some JS to overthrow this issue. But my JS fails when we have multiple sidebars on same screen. Below is my code for single sidebar.

"document.addEventListener('keydown', function(event){    if(event.key === "Escape"){     var div = document.querySelector('.sidebar');     var isactive = div.classList.contains('sidebar-open');     if(isactive === true){    $actions.SaveOnClick();}    console.log('new');    }});"


I tried to make many changes in this code so that it could run for 3 sidebars at least but no luck.

2024-12-19 07-54-27
Aditya Chinchole
Solution

Hi Team,

I am closing this Question as I got the solution.

What I did is kept the Javascript same but called it in a switch condition as per which sidebar is open.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.