inveniosoftware / inveniosoftware/react-invenio-forms
RichEditor props passing
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
## Is your feature request related to a problem? Please describe.
The rich editor component, is not accepting "rest" props. (https://github.com/inveniosoftware/react-invenio-forms/blob/f6ac055fc704c744561687c8a2f77925abd0ecd4/src/lib/forms/RichEditor.js#L21)
Meaning it is possible only to send specific props to the Editor from tinymce itself
` const {
id,
initialValue,
disabled,
minHeight,
onBlur,
onChange,
onFocus,
editorConfig,
inputValue,
onEditorChange,
} = this.props;`
Ideally it should be like this
` const {
id,
initialValue,
disabled,
minHeight,
onBlur,
onChange,
onFocus,
editorConfig,
inputValue,
onEditorChange,
...rest
} = this.props;`
`initialValue={initialValue}
value={inputValue}
init={config}
id={id}
disabled={disabled}
onBlur={onBlur}
onFocus={onFocus}
onChange={onChange}
onEditorChange={onEditorChange}
{...rest}
`
This can be helpful in various situations. Currently, we are working on our timeline feed, and I would like to register onKeyDown event, which would basically automatically trigger submit/edit of the comment, but it is not possible to do in current implementation unfortunately. I think this would be probably beneficial for RDM as well (that after typing you can just hit enter and send/edit the comment). Please let me know what you think. If there is no capacity on your end, I could make a PR.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.