Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 479f6c9

Browse files
authored
Merge pull request draft-js-plugins#596 from sugarshin/patch-1
Patch blockStyleFn
2 parents b957485 + e3ecc43 commit 479f6c9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

draft-js-plugins-editor/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1111
- `defaultBlockRenderMap` option, by default is set to true. If set to false the defaultBlockRenderMap from Draft.js is not used as base for the generated blockRenderMap.
1212
- `decorators` option now allows custom implementations the [DraftDecoratorType](https://github.com/facebook/draft-js/blob/master/src/model/decorators/DraftDecoratorType.js) interface to be passed into the array along with the traditional CompositeDecorator objects
1313
- added the utility function `composeDecorators` as a named export.
14+
- Ignore handle `blockStyleFn` in case its value is `null` . [#596](https://github.com/draft-js-plugins/draft-js-plugins/pull/596)
1415

1516
### Removed
1617

draft-js-plugins-editor/src/Editor/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class PluginEditor extends Component {
170170
for (const plugin of plugins) {
171171
if (typeof plugin[methodName] !== 'function') continue;
172172
const result = plugin[methodName](...newArgs);
173-
if (result !== undefined) {
173+
if (result !== undefined && result !== null) {
174174
styles = (styles ? (`${styles} `) : '') + result;
175175
}
176176
}

0 commit comments

Comments
 (0)