Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu not expanding on Android Chrome #10159

Closed
edtechre opened this issue Mar 16, 2023 · 9 comments
Closed

Menu not expanding on Android Chrome #10159

edtechre opened this issue Mar 16, 2023 · 9 comments
Labels
Support Support question

Comments

@edtechre
Copy link

edtechre commented Mar 16, 2023

Details

Tapping the hamburger menu icon does not expand the menu on Android Chrome.

Expected Result

The menu should expand. I tested on an identical Sphinx build with my own local server and it works fine there. But not when hosted on RTD.

Actual Result

Nothing happens when the hamburger icon is tapped.

@stsewd
Copy link
Member

stsewd commented Mar 17, 2023

Hi there, looks like jquery isn't being loaded on the theme. I see that you are using the latest version of the rtd theme, so jquery should be included, but for some reason is not..

@stsewd stsewd added the Support Support question label Mar 17, 2023
@edtechre
Copy link
Author

Thanks. My conf.py is here:
https://github.com/edtechre/pybroker/blob/master/docs/conf.py

I build locally with sphinx-build -n -W --keep-going -b html docs/ docs/_build/ and it works on my local server.

@edtechre
Copy link
Author

edtechre commented Mar 17, 2023

I do see jquery.js loading from https://www.pybroker.com/_/static/javascript/readthedocs-doc-embed.js

I tried making this fix:

  <script>
      window.addEventListener("load", function() {
         jQuery(function() {
            SphinxRtdTheme.Navigation.enable(true);
         });
      });
   </script>

Now I see this error thrown from theme.js:

Uncaught TypeError: e is not a function
    at Object.enable (theme.js:1:1246)
    at HTMLDocument.<anonymous> ((index):130:36)
    at e (jquery.js:1:30392)
    at t (jquery.js:1:30718)

@humitos
Copy link
Member

humitos commented Mar 20, 2023

I'm hitting the same issue/error.

You can see a live example at https://test-builds.readthedocs.io/en/manual-integrations/

@stsewd
Copy link
Member

stsewd commented Mar 20, 2023

@irmen
Copy link

irmen commented Mar 21, 2023

Confirming having the same issue for https://prog8.readthedocs.io/en/latest/

Worse is that the search box also doesn't work anymore

Firefox on Linux

@stsewd
Copy link
Member

stsewd commented Mar 21, 2023

I think a temporal solution is to add this in your conf.py file.

extensions = [
    "sphinxcontrib.jquery",
]

And there is no need to install the dependency, since the theme already installs it

@irmen
Copy link

irmen commented Mar 21, 2023

Thank you, this was indeed what fixed it for me

@stsewd
Copy link
Member

stsewd commented Mar 30, 2023

This is being tracked at readthedocs/sphinx_rtd_theme#1452.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

4 participants