react-contenteditable
react-contenteditable copied to clipboard
Allow passing onBlur, onKeyUp, onKeyDown while still running emitChange
https://github.com/lovasoa/react-contenteditable/blob/a7f6c78a38af1d2da7e95e13733683e8c8f0e77e/src/react-contenteditable.tsx#L48-L52
emitChange triggers onChange, which sends up a typed event with event.target.value attached
In my case, onBlur, onKeyUp, onKeyDown aren't used to change state, but to toggle CSS classes.
Proposal would be, if a function is passed to this.props.on{Blur,KeyUp,KeyDown}, pass (event: React.SyntheticEvent<any>, emitChange(originalEvt: React.SyntheticEvent<any>) => void) to the prop, this way, they could still run emitChange(event) if they want.
I don't think this would be possible due to the underlying typings of on{Blur,KeyUp,KeyDown}