draft-js-mention-plugin
Advanced tools
Comparing version 2.0.0-beta6 to 2.0.0-beta7
@@ -28,2 +28,3 @@ # Change Log | ||
- Fixed bug where `mentionPrefix` does not appear in `editorState`. `mentionPrefix` is no longer passed to `mentionComponent`. | ||
- Fixed bug where `onSearchChange` didn't fire when a user switched between two different mention autocompletions with the same search value. Now it will trigger `onSearchChange` in such a case. | ||
@@ -30,0 +31,0 @@ ## 1.1.2 - 2016-06-26 |
@@ -153,2 +153,4 @@ 'use strict'; | ||
var mentionComponent = config.mentionComponent; | ||
var _config$entityMutabil = config.entityMutability; | ||
var entityMutability = _config$entityMutabil === undefined ? 'SEGMENTED' : _config$entityMutabil; | ||
var _config$mentionTrigge = config.mentionTrigger; | ||
@@ -164,3 +166,3 @@ var mentionTrigger = _config$mentionTrigge === undefined ? '@' : _config$mentionTrigge; | ||
store: store, | ||
entityMutability: config.entityMutability ? config.entityMutability : 'SEGMENTED', | ||
entityMutability: entityMutability, | ||
positionSuggestions: positionSuggestions, | ||
@@ -167,0 +169,0 @@ mentionTrigger: mentionTrigger, |
@@ -171,2 +171,3 @@ 'use strict'; | ||
var lastActiveOffsetKey = _this.activeOffsetKey; | ||
_this.activeOffsetKey = selectionIsInsideWord.filter(function (value) { | ||
@@ -176,3 +177,3 @@ return value === true; | ||
_this.onSearchChange(editorState, selection); | ||
_this.onSearchChange(editorState, selection, _this.activeOffsetKey, lastActiveOffsetKey); | ||
@@ -203,3 +204,3 @@ // make sure the escaped search is reseted in the cursor since the user | ||
return editorState; | ||
}, _this.onSearchChange = function (editorState, selection) { | ||
}, _this.onSearchChange = function (editorState, selection, activeOffsetKey, lastActiveOffsetKey) { | ||
var _getSearchText = (0, _getSearchText3.default)(editorState, selection); | ||
@@ -210,3 +211,3 @@ | ||
var searchValue = word.substring(1, word.length); | ||
if (_this.lastSearchValue !== searchValue) { | ||
if (_this.lastSearchValue !== searchValue || activeOffsetKey !== lastActiveOffsetKey) { | ||
_this.lastSearchValue = searchValue; | ||
@@ -213,0 +214,0 @@ _this.props.onSearchChange({ value: searchValue }); |
{ | ||
"name": "draft-js-mention-plugin", | ||
"version": "2.0.0-beta6", | ||
"version": "2.0.0-beta7", | ||
"description": "Mention Plugin for DraftJS", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58639
1022