Skip to content

Commit bd303bf

Browse files
authored
Only toggle sidebar if it is closed (#305)
We were toggling the sidebar regardless of whether it was open or closed. This caused the back button to close the sidebar on the desktop instead of opening it (because it was already open).
1 parent ef9eab8 commit bd303bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: app/assets/javascripts/application.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
window.addEventListener("turbolinks:load", () => {
1717
if (window.matchMedia("(min-width: 768px)").matches) {
18-
document.querySelector("#sidebar summary").click();
18+
document.querySelector("#sidebar details:not(open) summary")?.click();
1919
}
2020
});

0 commit comments

Comments
 (0)