Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dreamworld/web-util

Package Overview
Dependencies
Maintainers
4
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dreamworld/web-util - npm Package Compare versions

Comparing version 1.4.3-fix-visual-viewport-issue-for-ios.7 to 1.4.3

2

package.json
{
"name": "@dreamworld/web-util",
"version": "1.4.3-fix-visual-viewport-issue-for-ios.7",
"version": "1.4.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

const alignTop = (scrollingElement, element, offsetTop) => {
console.log("alignTop ==> old-scrollTop", scrollingElement.scrollTop);
console.log("alignTop ==> new-scrollTop", element.offsetTop - offsetTop);
console.log("alignTop ==> element offsetTop", element.offsetTop);
console.log("alignTop ==> offsetTop", offsetTop);
scrollingElement.scrollTop = element.offsetTop - offsetTop;

@@ -13,8 +9,2 @@ }

let scrollingElementClientHeight = window.visualViewport ? window.visualViewport.height : scrollingElement.clientHeight;
console.log("alignBottom ==> old-scrollTop", scrollingElement.scrollTop);
console.log("alignBottom ==> new-scrollTop", element.offsetTop + element.offsetHeight + offsetBottom - scrollingElementClientHeight);
console.log("alignBottom ==> element offsetTop", element.offsetTop);
console.log("alignBottom ==> element offsetHeight", element.offsetHeight);
console.log("alignBottom ==> offsetBottom", offsetBottom);
console.log("alignBottom ==> scrollingElement clientHeight", scrollingElementClientHeight);
scrollingElement.scrollTop = element.offsetTop + element.offsetHeight + offsetBottom - scrollingElementClientHeight;

@@ -48,10 +38,2 @@ }

}
console.log("isFullVisible ==> scrollElementTop", scrollElementTop);
console.log("isFullVisible ==> offsetTop", offsetTop);
console.log("isFullVisible ==> scrollElementBottom", scrollElementBottom);
console.log("isFullVisible ==> offsetBottom", offsetBottom);
console.log("isFullVisible ==> elementRect.bottom", elementRect.bottom);
console.log("isFullVisible ==> elementRect.top", elementRect.top);
return true;

@@ -75,7 +57,5 @@ }

if (isFullVisible(scrollingElement, element, offsetTop, offsetBottom)) {
console.log("fully visible");
return;
}
console.log("not fully visible");
let scrollingElementClientHeight = window.visualViewport ? window.visualViewport.height : scrollingElement.clientHeight;

@@ -85,6 +65,4 @@ // If element client height > view-port's height

if (!bottom) {
console.log("align Top 1");
alignTop(scrollingElement, element, offsetTop);
} else {
console.log("align Bottom 1");
alignBottom(scrollingElement, element, offsetBottom);

@@ -96,3 +74,2 @@ }

if (element.offsetTop < (scrollingElement.scrollTop + offsetTop)) {
console.log("align Top 2");
alignTop(scrollingElement, element, offsetTop);

@@ -103,8 +80,5 @@ return;

if((element.offsetTop + element.offsetHeight) > (scrollingElement.scrollTop + scrollingElementClientHeight - offsetBottom)) {
console.log("align bottom 2");
alignBottom(scrollingElement, element, offsetBottom);
return;
}
console.log("not work proper.")
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc