Created
March 15, 2017 14:59
-
-
Save ArnaudRinquin/66abc3a4d29917db2f9af72b23766b6a to your computer and use it in GitHub Desktop.
DraftJS, Intercept copy events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount() { | |
this.el.addEventListener('copy', this.onCopy) | |
} | |
onCopy = (event) => { | |
const { editorState } = this.props | |
const contentState = editorState.getCurrentContent() | |
const html = convertToHTML(contentState); | |
console.log('converted!', html); | |
// TODO put reulst in the clipboard | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment