File tree Expand file tree Collapse file tree
src/providers/SurveyProvider/SurveyDialog/SurveyQuestion Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @equinor/amplify-component-lib" ,
3- "version" : " 12.0.2 " ,
3+ "version" : " 12.0.3 " ,
44 "description" : " Frontend Typescript components for the Amplify team" ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ export const SurveyLinearScaleQuestion: FC<SurveyLinearScaleQuestionProps> = ({
4343} ) => {
4444 const { currentAnswer, setCurrentAnswer } = useSurvey ( ) ;
4545 const rangeAmount = linearScaleVm . maxValue - linearScaleVm . minValue + 1 ;
46+ const currentNumericAnswer = (
47+ 'setAnswer' in rest ? rest . answer : currentAnswer
48+ ) ?. numericAnswer ;
4649
4750 const handleOnAnswer = ( numericAnswer : number ) => {
4851 if ( 'answer' in rest && 'setAnswer' in rest ) {
@@ -70,12 +73,9 @@ export const SurveyLinearScaleQuestion: FC<SurveyLinearScaleQuestionProps> = ({
7073 data-testid = { `range-radio-${ questionId . value } ` }
7174 name = { `range-${ questionId . value } ` }
7275 label = ""
73- checked = {
74- ( 'answer' in rest ? rest . answer : currentAnswer )
75- ?. numericAnswer ===
76- index + linearScaleVm . minValue
77- }
78- onClick = { ( ) => {
76+ value = { linearScaleVm . minValue + index }
77+ checked = { currentNumericAnswer === linearScaleVm . minValue + index }
78+ onChange = { ( ) => {
7979 handleOnAnswer ( linearScaleVm . minValue + index ) ;
8080 } }
8181 />
You can’t perform that action at this time.
0 commit comments