diff --git a/populate/src/main/resources/seed/portals/demo/studies/heartdemo/surveys/massachusettsSurvey.json b/populate/src/main/resources/seed/portals/demo/studies/heartdemo/surveys/massachusettsSurvey.json index 7fdcf7ed7..a567cf221 100644 --- a/populate/src/main/resources/seed/portals/demo/studies/heartdemo/surveys/massachusettsSurvey.json +++ b/populate/src/main/resources/seed/portals/demo/studies/heartdemo/surveys/massachusettsSurvey.json @@ -58,7 +58,7 @@ "en": "What did you study at MIT?", "es": "¿Qué estudiaste en MIT?" }, - "otherPlaceHolder": { + "otherPlaceholder": { "en": "Your major", "es": "Tu especialidad" } @@ -71,7 +71,7 @@ "en": "What did you study at Harvard?", "es": "¿Qué estudiaste en Harvard?" }, - "otherPlaceHolder": { + "otherPlaceholder": { "en": "Your major", "es": "Tu especialidad" } @@ -84,7 +84,7 @@ "en": "What did you study at Northeastern?", "es": "¿Qué estudiaste en Northeastern?" }, - "otherPlaceHolder": { + "otherPlaceholder": { "en": "Your major", "es": "Tu especialidad" } @@ -97,7 +97,7 @@ "en": "What did you study at Boston University?", "es": "¿Qué estudiaste en Boston University?" }, - "otherPlaceHolder": { + "otherPlaceholder": { "en": "Your major", "es": "Tu especialidad" } diff --git a/ui-core/src/surveyjs/checkbox-multiple-other.tsx b/ui-core/src/surveyjs/checkbox-multiple-other.tsx index 85f65cb2f..5c0ec3a7f 100644 --- a/ui-core/src/surveyjs/checkbox-multiple-other.tsx +++ b/ui-core/src/surveyjs/checkbox-multiple-other.tsx @@ -1,8 +1,6 @@ /** - * A SurveyJS question that renders a multiple selection combobox. - * This provides similar functionality as the "tagbox" in https://github.com/surveyjs/custom-widgets. - * However, this virtualizes the options list to support mahy more - * options while remaining performant. + * A SurveyJS custom renderer for checkboxes that includes an "other" text input + * for each choice that has a `jsonObj.otherStableId` property. */ import { ReactQuestionFactory, @@ -48,14 +46,14 @@ type Choice = ItemValue & { } -const OtherTextbox = ({ stableId, title, value, onChange }: { +const OtherTextbox = ({ stableId, title, value, onChange, placeholder }: { stableId: string title?: string placeholder?: string value: string onChange: (value: string) => void }) => { - const [otherValue, setOtherValue] = React.useState(value) + const [otherValue, setOtherValue] = React.useState(value || '') return