@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 CHANGED
@@ -2105,7 +2105,7 @@ var QuestionnaireForm = ({
2105
2105
  }) });
2106
2106
  case "select": {
2107
2107
  const currentValue = responses[questionId];
2108
- const hasOnlyOneOption = question.options?.length === 1;
2108
+ const hasOnlyOneOption = !!question?.options?.length;
2109
2109
  const defaultValue = hasOnlyOneOption && !currentValue && question.options?.[0] ? question.options[0].value || question.options[0].label : currentValue || "";
2110
2110
  if (hasOnlyOneOption && !currentValue && question.options?.[0]) {
2111
2111
  handleChange(questionId, defaultValue);