Skip to content

Commit 4744898

Browse files
committed
fix(undo/redo): stop propagation at click redo/undo button
change according to issue draft-js-plugins#1139, no side effect yet draft-js-plugins#1139
1 parent 7a1e3d6 commit 4744898

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

draft-js-undo-plugin/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## To Be Released
77

8+
### 2.0.2
9+
10+
- button not working while it's in the same container with editor [#1139](https://github.com/draft-js-plugins/draft-js-plugins/issues/1139)
11+
812
### Fixed
913

1014
- Fixed an issue during initialization [#740](https://github.com/draft-js-plugins/draft-js-plugins/pull/740). Thanks to @terryoy

draft-js-undo-plugin/src/RedoButton/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class RedoButton extends Component {
1010
theme: PropTypes.any,
1111
};
1212

13-
onClick = () => {
13+
onClick = (event) => {
14+
event.stopPropagation();
1415
this.props.store.setEditorState(EditorState.redo(this.props.store.getEditorState()));
1516
};
1617

draft-js-undo-plugin/src/UndoButton/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class UndoButton extends Component {
1010
theme: PropTypes.any,
1111
};
1212

13-
onClick = () => {
13+
onClick = (event) => {
14+
event.stopPropagation();
1415
this.props.store.setEditorState(EditorState.undo(this.props.store.getEditorState()));
1516
};
1617

0 commit comments

Comments
 (0)