Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions draft-js-modal-plugin/src/components/LinkModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ class Link extends Component {

componentDidMount () {
ReactDOM.findDOMNode(this.refs.textInput).focus()
this.props.store.subscribeToItem('editorState', this.onEditorStateChange)
}

componentWillUnmount() {
this.props.store.unsubscribeFromItem(
'editorState',
this.onEditorStateChange,
)
}

onEditorStateChange (editorState) {
console.log('onEditorStateChanged ')
this.props.closeModal()
}

onUrlChange (event) {
Expand Down
1 change: 1 addition & 0 deletions draft-js-toolbar-plugin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const createToolbarPlugin = (config = {}) => {
} else {
store.updateItem('isVisible', false)
}
store.updateItem('editorState', editorState)
return editorState
},
Toolbar: decorateComponentWithProps(Toolbar, toolbarProps)
Expand Down