Fix bug where scrolling up wouldn't show if it was offscreen
This commit is contained in:
parent
bc92b31cb3
commit
4010bc32d4
5
popup.js
5
popup.js
|
@ -500,7 +500,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
//Scroll if the tab index passes the top border.
|
||||
if (tabList[tabKeyIndex].getBoundingClientRect().top<=0){
|
||||
scrollBy(0, tabList[tabKeyIndex].clientHeight*-1);
|
||||
}
|
||||
}
|
||||
else if (tabKeyIndex>=0 && tabList[tabKeyIndex].getBoundingClientRect().bottom>=document.querySelector('body').clientHeight){
|
||||
scrollTo(0, tabList[tabKeyIndex].getBoundingClientRect().bottom);
|
||||
}
|
||||
}
|
||||
//If enter is pressed, switch to the tab.
|
||||
else if (event.keyCode===13){
|
||||
|
|
Loading…
Reference in a new issue