[TIP] Disable keyboard shortcuts in html coverage reports?

Thomi Richards thomi.richards at canonical.com
Wed Feb 26 20:05:39 PST 2014


Hi,


I use coverage.py's HTML coverage reports a lot, and they're great, except
that the keyboard shortcuts seem very broken. For example, when I'm in the
coverage report for a file, if I press the 'alt' key (which I do as part of
Alt+tab, for example) the browser will jump to somewhere near the top of
the page. Additionally, the space key toggles highlighted lines, even
though that's not mentioned as one of the shortcut keys. It seems like
whatever code is responsible for matching key presses to js code is being a
little too aggressive.

I'm no JS expert, but it looks to me like pressing the 'alt' key triggers
the handler function in coverage_html.js, specifically, this code:

  $(document).bind('keydown', c.substr(9), function () {

                    $(e).click();
                });


But the 'e' objects class is 'shortkey_r' or 'shortkey_m'.
Is there any additional information I can provide to help debug this?
Alternatively, is there an easy way to disable the shortcut key support?

I'm on Ubuntu Trusty Tahr, and can reproduce the problem with both Firefox
and Chromium. Has anyone else had this issue?

Cheers,
-- 
Thomi Richards
thomi.richards at canonical.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20140227/36bf2eb8/attachment.htm>


More information about the testing-in-python mailing list