Socket
Socket
Sign inDemoInstall

react-sane-contenteditable

Package Overview
Dependencies
7
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.4 to 1.3.5

15

lib/index.js

@@ -105,2 +105,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

ev.currentTarget.blur();
// Call onKeyUp directly as ev.preventDefault() means that it will not be called
_this._onKeyUp(ev);
}

@@ -111,7 +113,13 @@

ev.preventDefault();
// Call onKeyUp directly as ev.preventDefault() means that it will not be called
_this._onKeyUp(ev);
}
};
setTimeout(function () {
_this.props.onKeyDown(ev, _this._element.innerText);
}, 0);
_this._onKeyUp = function (ev) {
// Call prop.onKeyDown callback from the onKeyUp event to mitigate both of these issues:
// Access to Synthetic event: https://github.com/ashleyw/react-sane-contenteditable/issues/14
// Current value onKeyDown: https://github.com/ashleyw/react-sane-contenteditable/pull/6
// this._onKeyDown can't be moved in it's entirety to onKeyUp as we lose the opportunity to preventDefault
_this.props.onKeyDown(ev, _this._element.innerText);
};

@@ -196,2 +204,3 @@

onKeyDown: this._onKeyDown,
onKeyUp: this._onKeyUp,
onPaste: this._onPaste

@@ -198,0 +207,0 @@ }));

13

package.json
{
"name": "react-sane-contenteditable",
"version": "1.3.4",
"description":
"React component with sane defaults to make any element contentEditable",
"version": "1.3.5",
"description": "React component with sane defaults to make any element contentEditable",
"main": "lib/index.js",

@@ -12,3 +11,6 @@ "repository": {

"author": "Ashley Williams <hi@ashleyw.co.uk>",
"contributors": ["Raphael Silva Cavalcanti", "Jess Telford"],
"contributors": [
"Raphael Silva Cavalcanti",
"Jess Telford"
],
"license": "MIT",

@@ -45,4 +47,3 @@ "dependencies": {

"scripts": {
"build":
"./node_modules/.bin/babel src/react-sane-contenteditable.js --out-file lib/index.js",
"build": "./node_modules/.bin/babel src/react-sane-contenteditable.js --out-file lib/index.js",
"prepublish": "yarn build",

@@ -49,0 +50,0 @@ "demo": "./node_modules/rollup/bin/rollup --config example/rollup.config.js"

@@ -128,2 +128,4 @@ import React, { Component } from "react";

ev.currentTarget.blur();
// Call onKeyUp directly as ev.preventDefault() means that it will not be called
this._onKeyUp(ev);
}

@@ -139,7 +141,13 @@

ev.preventDefault();
// Call onKeyUp directly as ev.preventDefault() means that it will not be called
this._onKeyUp(ev);
}
};
setTimeout(() => {
this.props.onKeyDown(ev, this._element.innerText);
}, 0);
_onKeyUp = ev => {
// Call prop.onKeyDown callback from the onKeyUp event to mitigate both of these issues:
// Access to Synthetic event: https://github.com/ashleyw/react-sane-contenteditable/issues/14
// Current value onKeyDown: https://github.com/ashleyw/react-sane-contenteditable/pull/6
// this._onKeyDown can't be moved in it's entirety to onKeyUp as we lose the opportunity to preventDefault
this.props.onKeyDown(ev, this._element.innerText)
};

@@ -179,2 +187,3 @@

onKeyDown={this._onKeyDown}
onKeyUp={this._onKeyUp}
onPaste={this._onPaste}

@@ -181,0 +190,0 @@ />

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc