@anker-in/ui 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2091,7 +2091,7 @@ var QuestionnaireForm = ({
|
|
|
2091
2091
|
}) });
|
|
2092
2092
|
case "select": {
|
|
2093
2093
|
const currentValue = responses[questionId];
|
|
2094
|
-
const hasOnlyOneOption = question
|
|
2094
|
+
const hasOnlyOneOption = !!question?.options?.length;
|
|
2095
2095
|
const defaultValue = hasOnlyOneOption && !currentValue && question.options?.[0] ? question.options[0].value || question.options[0].label : currentValue || "";
|
|
2096
2096
|
if (hasOnlyOneOption && !currentValue && question.options?.[0]) {
|
|
2097
2097
|
handleChange(questionId, defaultValue);
|