Skip to content

Commit 4f606bb

Browse files
committed
Only toggle sidebar if it is closed
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 4f606bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/assets/javascripts/application.js

Lines changed: 1 addition & 1 deletion
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)