Skip to content

Commit c045506

Browse files
authored
refactor(mantine): migrate nlp qa number input DEV-1163 (#6373)
### 💭 Notes `NumberInput` from mantine returns a number, but the logic of the response form requires a string. Instead of doing too much work I just converted the mantine return to a string ### 👀 Preview steps 1. ℹ️ have an account and a project with submissions to open nlp 2. create a "Number" analysis question 5. 🟢 [on PR] notice that the functionality remains the same
1 parent 2baa76d commit c045506

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

jsapp/js/components/processing/analysis/responseForms/integerResponseForm.component.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import { NumberInput } from '@mantine/core'
12
import React, { useContext, useState } from 'react'
2-
3-
import TextBox from '#/components/common/textBox'
43
import AnalysisQuestionsContext from '#/components/processing/analysis/analysisQuestions.context'
54
import { AUTO_SAVE_TYPING_DELAY } from '#/components/processing/analysis/constants'
65
import {
@@ -70,10 +69,9 @@ export default function IntegerResponseForm(props: IntegerResponseFormProps) {
7069
<CommonHeader uuid={props.uuid} />
7170

7271
<section className={commonStyles.content}>
73-
<TextBox
74-
type='number'
72+
<NumberInput
7573
value={response}
76-
onChange={onInputChange}
74+
onChange={(newResponse) => onInputChange(newResponse.toString())}
7775
placeholder={t('Type your answer')}
7876
onBlur={saveResponse}
7977
disabled={!props.canEdit}

0 commit comments

Comments
 (0)