Skip to content

Commit

Permalink
editor: added config prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatimah committed Nov 16, 2023
1 parent ee9376c commit b2d2727
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/forms/RichInputField.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Form } from "semantic-ui-react";

export class RichInputField extends Component {
renderFormField = (formikBag) => {
const { fieldPath, label, required, className, editor } = this.props;
const { fieldPath, label, required, className, editor, editorConfig } = this.props;
const value = getIn(formikBag.form.values, fieldPath, "");
const initialValue = getIn(formikBag.form.initialValues, fieldPath, "");
const error =
Expand All @@ -41,6 +41,7 @@ export class RichInputField extends Component {
<RichEditor
value={value}
optimized
editorConfig={editorConfig}
onBlur={(event, editor) => {
formikBag.form.setFieldValue(fieldPath, editor.getContent());
formikBag.form.setFieldTouched(fieldPath, true);
Expand Down Expand Up @@ -70,6 +71,7 @@ RichInputField.propTypes = {
optimized: PropTypes.bool,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
required: PropTypes.bool,
editorConfig: PropTypes.object,
};

RichInputField.defaultProps = {
Expand All @@ -78,4 +80,5 @@ RichInputField.defaultProps = {
required: false,
label: "",
editor: undefined,
editorConfig: null,
};

0 comments on commit b2d2727

Please sign in to comment.