Commit ab4ecce7 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

배열에 키 추가

parent 35d3386f
...@@ -153,6 +153,7 @@ export const Question = ({ ...@@ -153,6 +153,7 @@ export const Question = ({
name="type" name="type"
onChange={handleSelect} onChange={handleSelect}
disabled={save} disabled={save}
value={element.type}
className="w-36 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-themeColor w-full mr-3 p-2.5" className="w-36 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-themeColor w-full mr-3 p-2.5"
> >
{Array.from(QUESTION_TYPES.entries()).map(([key, value]) => ( {Array.from(QUESTION_TYPES.entries()).map(([key, value]) => (
...@@ -160,7 +161,7 @@ export const Question = ({ ...@@ -160,7 +161,7 @@ export const Question = ({
key={key} key={key}
id={element._id} id={element._id}
value={key} value={key}
selected={key === element.type} // selected={key === element.type}
> >
{value} {value}
</option> </option>
......
...@@ -129,6 +129,7 @@ export const EditSurvey = () => { ...@@ -129,6 +129,7 @@ export const EditSurvey = () => {
</div> </div>
{questions.map((question) => ( {questions.map((question) => (
<Question <Question
key={question._id}
element={question} element={question}
handleQuestion={handleQuestion} handleQuestion={handleQuestion}
deleteQuestion={deleteQuestion} deleteQuestion={deleteQuestion}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment