diff --git a/packages/builder/src/components/ComponentOptions/components/Content/Page/components/ItemOptions/components/Likert.js b/packages/builder/src/components/ComponentOptions/components/Content/Page/components/ItemOptions/components/Likert.js index e95cb7fa3..9aa0cfdff 100644 --- a/packages/builder/src/components/ComponentOptions/components/Content/Page/components/ItemOptions/components/Likert.js +++ b/packages/builder/src/components/ComponentOptions/components/Content/Page/components/ItemOptions/components/Likert.js @@ -1,74 +1,77 @@ import React from 'react' import { range } from 'lodash' -import { Control, Field } from 'react-redux-form' +import { Field, FastField, useFormikContext, getIn } from 'formik' import { Row, Col, FormGroup, Label, FormText, - Input, InputGroup, InputGroupAddon, InputGroupText } from 'reactstrap' + InputGroup, InputGroupAddon, InputGroupText } from 'reactstrap' + +import { Input } from '../../../../../../../Form' import { CodingGroup } from './Coding' import { CollapsingOptions } from './BaseOptions' -export default ({ data, rowIndex }) => - <> +export default ({ name, index }) => { + const { values } = useFormikContext() + const width = getIn(values, `${ name }.width`) + + return <> - - + Scale width How many points to offer - - - { - [5, 7, 9, 11].map(w => - + { + [5, 7, 9, 11].map(w => + + + - - - { w } - - - ) - } - - + { w } + + + ) + } + - + Anchors @@ -76,10 +79,10 @@ export default ({ data, rowIndex }) => { - range(data.width).map(i => + range(width).map(i => @@ -90,10 +93,9 @@ export default ({ data, rowIndex }) => - @@ -106,3 +108,4 @@ export default ({ data, rowIndex }) => > +}