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

react-portal-popover

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-portal-popover - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

8

examples/index.js

@@ -30,9 +30,9 @@ import React from 'react';

<div>
<OverlayTrigger overlay={toolTip} label={'Excerpt'} showLabel={'Show'} hideLabel={'Hide'}>
<OverlayTrigger closeOnScroll={true} overlay={toolTip} label={'Excerpt'} showLabel={'Show'} hideLabel={'Hide'}>
<button>Toggle</button>
</OverlayTrigger>
<div style={right}>
<OverlayTrigger overlay={toolTip} label={'Excerpt'} showLabel={'Show'} hideLabel={'Hide'}>
<button>Toggle 2</button>
</OverlayTrigger>
<OverlayTrigger closeOnScroll={true} overlay={toolTip} label={'Excerpt'} showLabel={'Show'} hideLabel={'Hide'}>
<button>Toggle 2</button>
</OverlayTrigger>
</div>

@@ -39,0 +39,0 @@ </div>

@@ -41,2 +41,3 @@ 'use strict';

_this.accessibleLabel = _this.accessibleLabel.bind(_this);
_this.onScroll = _this.onScroll.bind(_this);
return _this;

@@ -51,3 +52,4 @@ }

if (this.props.closeOnScroll) {
document.addEventListener('scroll', this.onClickOutside);
// Use capture for scroll events
window.addEventListener('scroll', this.onScroll, true);
}

@@ -61,3 +63,3 @@ }

if (this.props.closeOnScroll) {
document.removeEventListener('scroll', this.onClickOutside);
window.removeEventListener('scroll', this.onScroll, false);
}

@@ -106,2 +108,9 @@ }

}, {
key: 'onScroll',
value: function onScroll() {
this.setState({
open: false
});
}
}, {
key: 'onClickOutside',

@@ -108,0 +117,0 @@ value: function onClickOutside() {

{
"name": "react-portal-popover",
"version": "0.1.10",
"version": "0.1.11",
"description": "Popover for React using portals",

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

@@ -1,2 +0,2 @@

// 'use strict';
'use strict';

@@ -3,0 +3,0 @@ const path = require('path');

@@ -17,2 +17,3 @@ import React from 'react';

this.accessibleLabel = this.accessibleLabel.bind(this);
this.onScroll = this.onScroll.bind(this);
}

@@ -24,3 +25,4 @@

if (this.props.closeOnScroll) {
document.addEventListener('scroll', this.onClickOutside);
// Use capture for scroll events
window.addEventListener('scroll', this.onScroll, true);
}

@@ -33,3 +35,3 @@ }

if (this.props.closeOnScroll) {
document.removeEventListener('scroll', this.onClickOutside);
window.removeEventListener('scroll', this.onScroll, false);
}

@@ -70,2 +72,8 @@ }

onScroll() {
this.setState({
open: false,
});
}
onClickOutside() {

@@ -72,0 +80,0 @@ this.removeCloseHandler();

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