fix the popup width bug in FF when scrollbar is shown
* scrollbar width is not subtracted in FF from the actual width * in some versions of FF the paddings should be added on both sides
This commit is contained in:
parent
8265d0c8e4
commit
4601a136a9
|
@ -111,6 +111,17 @@ window.addEventListener('showStyles:done', function _() {
|
|||
dom.list = $('#search-results-list');
|
||||
|
||||
addEventListener('scroll', loadMoreIfNeeded, {passive: true});
|
||||
if (FIREFOX) {
|
||||
addEventListener('resize', () => {
|
||||
const scrollbarWidth = window.innerWidth - document.scrollingElement.clientWidth;
|
||||
if (scrollbarWidth !== parseFloat(document.body.style.paddingRight)) {
|
||||
dom.marginLeft = dom.marginLeft || parseFloat(getComputedStyle(dom.container).marginLeft);
|
||||
const shift = dom.container.getBoundingClientRect().left - dom.marginLeft;
|
||||
document.body.style.setProperty('padding',
|
||||
`0 ${scrollbarWidth - shift}px 0 ${shift}px`, 'important');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
addEventListener('styleDeleted', ({detail}) => {
|
||||
const entries = [...dom.list.children];
|
||||
|
|
Loading…
Reference in New Issue
Block a user