react-mentions 4.4.8 → 4.4.9

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-mentions
2
2
 
3
+ ## 4.4.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 0e26027: Fix double-paste bug
8
+
3
9
  ## 4.4.8
4
10
 
5
11
  ### Patch Changes
@@ -1937,9 +1937,9 @@ var MentionsInput = /*#__PURE__*/function (_React$Component) {
1937
1937
 
1938
1938
  if (!this.supportsClipboardActions(event)) {
1939
1939
  return;
1940
- } // event.preventDefault()
1941
-
1940
+ }
1942
1941
 
1942
+ event.preventDefault();
1943
1943
  var _this$state3 = this.state,
1944
1944
  selectionStart = _this$state3.selectionStart,
1945
1945
  selectionEnd = _this$state3.selectionEnd;
@@ -1122,6 +1122,7 @@ var makeTriggerRegex = function(trigger) {
1122
1122
  key: "handlePaste",
1123
1123
  value: function(event) {
1124
1124
  if (event.target === this.inputElement && this.supportsClipboardActions(event)) {
1125
+ event.preventDefault();
1125
1126
  var _this$state3 = this.state, selectionStart = _this$state3.selectionStart, selectionEnd = _this$state3.selectionEnd, _this$props7 = this.props, value = _this$props7.value, children = _this$props7.children, config = readConfigFromChildren(children), markupStartIndex = mapPlainTextIndex(value, config, selectionStart, "START"), markupEndIndex = mapPlainTextIndex(value, config, selectionEnd, "END"), pastedMentions = event.clipboardData.getData("text/react-mentions"), pastedData = event.clipboardData.getData("text/plain"), newValue = spliceString(value, markupStartIndex, markupEndIndex, pastedMentions || pastedData).replace(/\r/g, ""), newPlainTextValue = getPlainText(newValue, config), eventMock = {
1126
1127
  target: _objectSpread$1(_objectSpread$1({}, event.target), {}, {
1127
1128
  value: newValue
@@ -1929,9 +1929,9 @@ var MentionsInput = /*#__PURE__*/function (_React$Component) {
1929
1929
 
1930
1930
  if (!this.supportsClipboardActions(event)) {
1931
1931
  return;
1932
- } // event.preventDefault()
1933
-
1932
+ }
1934
1933
 
1934
+ event.preventDefault();
1935
1935
  var _this$state3 = this.state,
1936
1936
  selectionStart = _this$state3.selectionStart,
1937
1937
  selectionEnd = _this$state3.selectionEnd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-mentions",
3
- "version": "4.4.8",
3
+ "version": "4.4.9",
4
4
  "description": "React mentions input",
5
5
  "main": "dist/react-mentions.cjs.js",
6
6
  "module": "dist/react-mentions.esm.js",