Calc isSidebarFitsViewport
drebot92 opened this issue ยท 0 comments
drebot92 commented
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch sticky-sidebar@3.3.1
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/sticky-sidebar/dist/sticky-sidebar.js b/node_modules/sticky-sidebar/dist/sticky-sidebar.js
index 9a7cad4..e0707ec 100644
--- a/node_modules/sticky-sidebar/dist/sticky-sidebar.js
+++ b/node_modules/sticky-sidebar/dist/sticky-sidebar.js
@@ -308,7 +308,7 @@ var StickySidebar = function () {
}, {
key: 'isSidebarFitsViewport',
value: function isSidebarFitsViewport() {
- return this.dimensions.sidebarHeight < this.dimensions.viewportHeight;
+ return this.dimensions.sidebarHeight < this.dimensions.viewportHeight - this.dimensions.topSpacing - this.dimensions.bottomSpacing;
}
/**
This issue body was partially generated by patch-package.