temp
This commit is contained in:
parent
fb4ab92b88
commit
6b0b681218
17
src/helpers/dom/getScrollPadding.ts
Normal file
17
src/helpers/dom/getScrollPadding.ts
Normal file
@ -0,0 +1,17 @@
|
||||
export default function getScrollPadding() {
|
||||
const container = document.createElement('div');
|
||||
container.classList.add('scrollable', 'scrollable-y');
|
||||
container.style.cssText = 'width: 100px; height: 100px; position: absolute; top: -9999px;';
|
||||
|
||||
const child = document.createElement('div');
|
||||
child.style.cssText = 'width: 100%; height: 110px;';
|
||||
|
||||
container.append(child);
|
||||
document.body.append(container);
|
||||
|
||||
const diff = container.offsetWidth - child.offsetWidth;
|
||||
container.remove();
|
||||
return diff;
|
||||
}
|
||||
|
||||
(window as any).testBuggedScroll = getScrollPadding;
|
Loading…
x
Reference in New Issue
Block a user