Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue2: fix dropdown throws errors when setting data #7346

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/vue/components/dropdown/dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

<div :class="question.cssClasses.controlValue">
<survey-string
v-if="question.showSelectedItemLocText"
:locString="question.selectedItemLocText"
v-if="showSelectedItemLocText"
:locString="selectedItemLocText"
/>
<div v-if="model.showHintString" :class="question.cssClasses.hintSuffix">
<span style="visibility: hidden">{{ model.inputStringRendered }}</span>
Expand Down Expand Up @@ -82,8 +82,8 @@
></sv-popup>
<div disabled v-else :id="question.inputId" :class="question.getControlClass()">
<survey-string
v-if="question.selectedItemLocText"
:locString="question.selectedItemLocText"
v-if="selectedItemLocText"
:locString="selectedItemLocText"
/>
<div>{{ question.readOnlyText }}</div>
</div>
Expand Down Expand Up @@ -128,6 +128,14 @@ export class DropdownComponent extends BaseVue {
this.model.inputStringRendered = event.target.value;
}

public get showSelectedItemLocText() {
return this.question.showSelectedItemLocText;
}

public get selectedItemLocText() {
return this.question.selectedItemLocText;
}

public click(event: any) {
this.model?.onClick(event);
}
Expand Down