File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/panels/lovelace/views Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
123123 "section-visibility-changed" ,
124124 this . _sectionVisibilityChanged
125125 ) ;
126+ this . _showSidebar = Boolean ( window . history . state ?. sidebar ) ;
126127 }
127128
128129 disconnectedCallback ( ) : void {
@@ -428,6 +429,12 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
428429
429430 this . _showSidebar = ! this . _showSidebar ;
430431
432+ // Add sidebar state to history
433+ window . history . replaceState (
434+ { ...window . history . state , sidebar : this . _showSidebar } ,
435+ ""
436+ ) ;
437+
431438 // Restore scroll position after view updates
432439 this . updateComplete . then ( ( ) => {
433440 const scrollY = this . _showSidebar
You can’t perform that action at this time.
0 commit comments