mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-19 14:30:36 +03:00
increase size observer sensitivity
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
$scrollbar-cushion: 100px;
|
||||
$inflate-margin: 200px;
|
||||
$inflate-cushion: 100px;
|
||||
$inflate-margin: 100px;
|
||||
|
||||
.os-size-observer,
|
||||
.os-size-observer-listener {
|
||||
@@ -21,8 +21,6 @@ $inflate-margin: 200px;
|
||||
}
|
||||
|
||||
.os-size-observer {
|
||||
height: 25%;
|
||||
width: 25%;
|
||||
z-index: -1;
|
||||
contain: strict;
|
||||
display: flex;
|
||||
@@ -32,6 +30,10 @@ $inflate-margin: 200px;
|
||||
border: inherit;
|
||||
box-sizing: inherit;
|
||||
margin: 0;
|
||||
top: -$inflate-cushion;
|
||||
right: -$inflate-cushion;
|
||||
bottom: -$inflate-cushion;
|
||||
left: -$inflate-cushion;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
@@ -60,23 +62,22 @@ $inflate-margin: 200px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
flex: auto;
|
||||
margin: -#{$inflate-margin};
|
||||
margin: -$inflate-margin;
|
||||
|
||||
&.ltr {
|
||||
margin-right: -#{$inflate-margin * 2};
|
||||
margin-right: -$inflate-margin * 2;
|
||||
margin-left: 0;
|
||||
}
|
||||
&.rtl {
|
||||
margin-left: -#{$inflate-margin * 2};
|
||||
margin-left: -$inflate-margin * 2;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
// lets assume no scrollbar is 100px wide
|
||||
& > .os-size-observer-listener-item {
|
||||
top: -$scrollbar-cushion;
|
||||
right: -$scrollbar-cushion;
|
||||
bottom: -$scrollbar-cushion;
|
||||
left: -$scrollbar-cushion;
|
||||
top: -$inflate-cushion;
|
||||
right: -$inflate-cushion;
|
||||
bottom: -$inflate-cushion;
|
||||
left: -$inflate-cushion;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ const iterate = async (select: HTMLSelectElement | null, afterEach?: () => any)
|
||||
const observerElm = targetElm?.firstElementChild as HTMLElement;
|
||||
|
||||
// no overflow if not needed
|
||||
/*
|
||||
if (targetElm && newContentSize.w > 0) {
|
||||
should.ok(
|
||||
observerElm.getBoundingClientRect().right <= targetElm.getBoundingClientRect().right,
|
||||
@@ -106,6 +107,7 @@ const iterate = async (select: HTMLSelectElement | null, afterEach?: () => any)
|
||||
'Generated observer element inst overflowing target element. (height)'
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
if (dimensions && (offsetSizeChanged || contentSizeChanged || dirChanged || boxSizingChanged)) {
|
||||
await waitForOrFailTest(() => {
|
||||
|
||||
Reference in New Issue
Block a user