Open tony opened 3 years ago
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}
https://github.com/lovasoa/react-contenteditable/blob/a7f6c78a38af1d2da7e95e13733683e8c8f0e77e/src/react-contenteditable.tsx#L48-L52
emitChange
triggersonChange
, which sends up a typed event withevent.target.value
attachedIn my case,
onBlur
,onKeyUp
,onKeyDown
aren't used to change state, but to toggle CSS classes.