Skip to content

Commit

Permalink
Fix iPad Pro navigation not shown (#1236)
Browse files Browse the repository at this point in the history
Found this issue when I was debugging the navigation toggle. I noticed
it first in the chrome dev tools, but it was also reproducible on
an iPad Pro.

Symptom:
- On iPad Pro, the navigation section is hidden but there's enough
  space to show it. Making the user have to click the hamburger
  button to show it but it's not necessary to hide the navigation
  section.
- On desktop, the navigation section is shown.
- On mobile, the navigation section is hidden until the hamburger
  button is clicked.

Fix:
- The javascript code was matching 1024px instead of 1023px. The media
  sections of the css was altering the layout on 1024px. So ipad got
  the full desktop layout but the navigation section was hidden.
  • Loading branch information
sunblaze authored Dec 15, 2024
1 parent d1cb9dc commit 1794e59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/darkfish/js/darkfish.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function hookSidebar() {
navigationToggle.ariaExpanded = navigationToggle.ariaExpanded !== 'true';
});

var isSmallViewport = window.matchMedia("(max-width: 1024px)").matches;
var isSmallViewport = window.matchMedia("(max-width: 1023px)").matches;
if (isSmallViewport) {
navigation.hidden = true;
navigationToggle.ariaExpanded = false;
Expand Down

0 comments on commit 1794e59

Please sign in to comment.