Skip to content

readthedocs theme TOC scrolling JS exception #1177

@cgwyllie

Description

@cgwyllie

In the readthedocs theme (mkdocs, version 0.16.2) we're seeing an exception from this line: bounds.top = this.offset().top; in the theme.js file.

It seems this was introduced by #1156 and referenced from #803.

We can observe it happening when the currently active TOC item is below the fold (scrolled off screen to the bottom).

Here's the stack trace:

Uncaught TypeError: Cannot read property 'top' of undefined
    at n.fn.init.$.fn.isFullyWithinViewport (theme.js:67)
    at HTMLDocument.<anonymous> (theme.js:74)
    at j (jquery-2.1.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-2.1.1.min.js:2)
    at Function.ready (jquery-2.1.1.min.js:2)
    at HTMLDocument.I (jquery-2.1.1.min.js:2)

Testing in Chrome 56.0.2924.87 on macOS 10.12.3.

As a workaround we've created an override theme.js file to remove the scroll behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions