diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-10-27 18:01:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 18:01:21 +0300 |
commit | 8bd16000709e8ee31ceb68baccecfed1b5b3f1bf (patch) | |
tree | d346d5d8f8461f076b13e64b511630c61a2f7a11 /sphinx/themes | |
parent | 15d94fcfc1c2837fe7bd34c2abc298f18cfe3a36 (diff) | |
parent | 9115aa8db0040b68ea851e2bc9ea2641100fad2a (diff) |
Merge pull request #8316 from foster999/patch-1
Prevent arrow keys changing page when button elements are focused
Diffstat (limited to 'sphinx/themes')
-rw-r--r-- | sphinx/themes/basic/static/doctools.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js index daccd209d..7d88f807d 100644 --- a/sphinx/themes/basic/static/doctools.js +++ b/sphinx/themes/basic/static/doctools.js @@ -285,9 +285,10 @@ var Documentation = { initOnKeyListeners: function() { $(document).keydown(function(event) { var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea + // don't navigate when in search box, textarea, dropdown or button if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' - && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { + && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey + && !event.shiftKey) { switch (event.keyCode) { case 37: // left var prevHref = $('link[rel="prev"]').prop('href'); |