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

react-outside-click-handler

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-outside-click-handler - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

7

build/OutsideClickHandler.js

@@ -19,2 +19,6 @@ Object.defineProperty(exports, "__esModule", {

var _object = require('object.values');
var _object2 = _interopRequireDefault(_object);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

@@ -30,2 +34,3 @@

BLOCK: 'block',
FLEX: 'flex',
INLINE_BLOCK: 'inline-block'

@@ -197,3 +202,3 @@ };

ref: this.setChildNodeRef,
style: display === DISPLAY.INLINE_BLOCK ? { display: display } : undefined
style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined
},

@@ -200,0 +205,0 @@ children

# Change Log
## v1.1.0
- Add `flex` as a display prop option ([#4](https://github.com/airbnb/react-outside-click-handler/pull/4))
## v1.0.0
- Initial commit

4

esm/OutsideClickHandler.js

@@ -14,5 +14,7 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

import { addEventListener } from 'consolidated-events';
import objectValues from 'object.values';
var DISPLAY = {
BLOCK: 'block',
FLEX: 'flex',
INLINE_BLOCK: 'inline-block'

@@ -184,3 +186,3 @@ };

ref: this.setChildNodeRef,
style: display === DISPLAY.INLINE_BLOCK ? { display: display } : undefined
style: display !== DISPLAY.BLOCK && objectValues(DISPLAY).includes(display) ? { display: display } : undefined
},

@@ -187,0 +189,0 @@ children

{
"name": "react-outside-click-handler",
"version": "1.0.0",
"version": "1.1.0",
"description": "A React component for dealing with clicks outside its subtree",

@@ -68,2 +68,3 @@ "main": "index.js",

"consolidated-events": "^1.1.1",
"object.values": "^1.0.4",
"prop-types": "^15.6.1"

@@ -70,0 +71,0 @@ },

@@ -47,4 +47,4 @@ # react-outside-click-handler

### display: `PropTypes.oneOf(['block', 'inline-block'])`
### display: `PropTypes.oneOf(['block', 'flex', 'inline-block'])`
By default, the `OutsideClickHandler` renders a `display: block` `<div />` to wrap the subtree defined by `children`. If desired, the `display` can be set to `inline-block` instead. There is no way not to render a wrapping `<div />`.
By default, the `OutsideClickHandler` renders a `display: block` `<div />` to wrap the subtree defined by `children`. If desired, the `display` can be set to `inline-block` or `flex` instead. There is no way not to render a wrapping `<div />`.

@@ -6,5 +6,7 @@ import React from 'react';

import { addEventListener } from 'consolidated-events';
import objectValues from 'object.values';
const DISPLAY = {
BLOCK: 'block',
FLEX: 'flex',
INLINE_BLOCK: 'inline-block',

@@ -116,3 +118,7 @@ };

ref={this.setChildNodeRef}
style={display === DISPLAY.INLINE_BLOCK ? { display } : undefined}
style={
display !== DISPLAY.BLOCK && objectValues(DISPLAY).includes(display)
? { display }
: undefined
}
>

@@ -119,0 +125,0 @@ {children}

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