File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
cli/src/components/ask-user Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,14 @@ export const AccordionQuestion: React.FC<AccordionQuestionProps> = ({
121121
122122 // Question number (1-indexed) - only shown when multiple questions
123123 const questionNumber = questionIndex + 1
124+ const isCustomSelected = answer ?. isOther ?? false
125+ const customSymbol = isMultiSelect
126+ ? isCustomSelected
127+ ? SYMBOLS . CHECKBOX_CHECKED
128+ : SYMBOLS . CHECKBOX_UNCHECKED
129+ : isCustomSelected
130+ ? SYMBOLS . SELECTED
131+ : SYMBOLS . UNSELECTED
124132
125133 return (
126134 < box style = { { flexDirection : 'column' , marginBottom : 1 } } >
@@ -187,7 +195,7 @@ export const AccordionQuestion: React.FC<AccordionQuestionProps> = ({
187195 )
188196 } ) }
189197
190- { /* Custom option - text input (always uses radio button style) */ }
198+ { /* Custom option - uses checkbox style for multi-select questions */ }
191199 < Button
192200 onClick = { ( ) => {
193201 if ( isMultiSelect ) {
@@ -218,7 +226,7 @@ export const AccordionQuestion: React.FC<AccordionQuestionProps> = ({
218226 : undefined ,
219227 } }
220228 >
221- { answer ?. isOther ? SYMBOLS . SELECTED : SYMBOLS . UNSELECTED }
229+ { customSymbol }
222230 </ text >
223231 < text
224232 style = { {
Original file line number Diff line number Diff line change @@ -198,12 +198,15 @@ export const MultipleChoiceForm: React.FC<MultipleChoiceFormProps> = ({
198198 setAnswerForQuestion ( questionIndex , ( currentAnswer ) =>
199199 isOtherOption
200200 ? {
201- ...currentAnswer ,
201+ // Selecting "Custom" should clear any single-select choice
202+ selectedIndex : undefined ,
203+ selectedIndices : undefined ,
202204 isOther : true ,
203205 otherText : currentAnswer ?. otherText || '' ,
204206 }
205207 : {
206208 selectedIndex : optionIndex ,
209+ selectedIndices : undefined ,
207210 isOther : false ,
208211 } ,
209212 )
You can’t perform that action at this time.
0 commit comments