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

draft-js-mention-plugin

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draft-js-mention-plugin - npm Package Compare versions

Comparing version 2.0.0-beta6 to 2.0.0-beta7

1

CHANGELOG.md

@@ -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

4

lib/index.js

@@ -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": {

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