Socket
Socket
Sign inDemoInstall

@semcore/portal

Package Overview
Dependencies
Maintainers
1
Versions
210
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semcore/portal - npm Package Compare versions

Comparing version 2.5.17 to 2.6.0

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # Changelog

## [2.6.0] - 2023-03-27
### Added
- Supported ignoring parent portals nesting via `ignorePortalsStacking`.
## [2.5.17] - 2023-03-28

@@ -7,0 +13,0 @@

7

lib/cjs/Portal.js

@@ -31,6 +31,7 @@ "use strict";

var Children = props.Children,
disablePortal = props.disablePortal;
disablePortal = props.disablePortal,
ignorePortalsStacking = props.ignorePortalsStacking;
var container = (0, _react.useContext)(PortalContext);
var _useState = (0, _react.useState)((0, _ref.getNodeByRef)(container)),
var _useState = (0, _react.useState)(ignorePortalsStacking ? document.body : (0, _ref.getNodeByRef)(container)),
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),

@@ -42,3 +43,3 @@ mountNode = _useState2[0],

if (!disablePortal) {
setMountNode((0, _ref.getNodeByRef)(container));
setMountNode(ignorePortalsStacking ? document.body : (0, _ref.getNodeByRef)(container));
}

@@ -45,0 +46,0 @@ }, [container, disablePortal]);

@@ -14,6 +14,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";

var Children = props.Children,
disablePortal = props.disablePortal;
disablePortal = props.disablePortal,
ignorePortalsStacking = props.ignorePortalsStacking;
var container = useContext(PortalContext);
var _useState = useState(getNodeByRef(container)),
var _useState = useState(ignorePortalsStacking ? document.body : getNodeByRef(container)),
_useState2 = _slicedToArray(_useState, 2),

@@ -25,3 +26,3 @@ mountNode = _useState2[0],

if (!disablePortal) {
setMountNode(getNodeByRef(container));
setMountNode(ignorePortalsStacking ? document.body : getNodeByRef(container));
}

@@ -28,0 +29,0 @@ }, [container, disablePortal]);

@@ -6,2 +6,4 @@ import React from 'react';

disablePortal?: boolean;
/** Disabled attaching portals to the parent portals and enabling attaching directly to document.body */
ignorePortalsStacking?: boolean;
}

@@ -8,0 +10,0 @@ declare const PortalProvider: React.Provider<NodeByRef>;

{
"name": "@semcore/portal",
"description": "Semrush Portal Component",
"version": "2.5.17",
"version": "2.6.0",
"main": "lib/cjs/index.js",

@@ -6,0 +6,0 @@ "module": "lib/es6/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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