Skip to content

Commit

Permalink
Fix: Vue (radiogroup and checkbox questions): enableIf in choices pro…
Browse files Browse the repository at this point in the history
…perty doesn't work correctly #2807
  • Loading branch information
andrewtelnov committed Apr 20, 2021
1 parent eebd0c7 commit c5e90a7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
23 changes: 17 additions & 6 deletions src/vue/checkboxitem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
v-bind:aria-required="question.isRequired"
:aria-label="item.locText.renderedHtml"
:aria-invalid="question.errors.length > 0"
:aria-describedby="question.errors.length > 0 ? question.id + '_errors' : null"
:aria-describedby="
question.errors.length > 0 ? question.id + '_errors' : null
"
:class="question.cssClasses.itemControl"
/>
<input
Expand All @@ -26,7 +28,9 @@
v-bind:aria-required="question.isRequired"
:aria-label="item.locText.renderedHtml"
:aria-invalid="question.errors.length > 0"
:aria-describedby="question.errors.length > 0 ? question.id + '_errors' : null"
:aria-describedby="
question.errors.length > 0 ? question.id + '_errors' : null
"
:class="question.cssClasses.itemControl"
/>
<span :class="question.cssClasses.materialDecorator">
Expand All @@ -44,23 +48,30 @@
</span>
</label>
<survey-other-choice
v-show="question.hasOther && question.renderedValue && question.isOtherSelected"
v-show="
question.hasOther && question.renderedValue && question.isOtherSelected
"
v-if="item.value == question.otherItem.value"
:question="question"
/>
</div>
</template>

<script lang="ts">
import { ItemValue, Base } from "survey-core";
import Vue from "vue";
import { Component, Prop } from "vue-property-decorator";
import { BaseVue } from "./base";
@Component
export class CheckboxItem extends Vue {
export class CheckboxItem extends BaseVue {
@Prop() question: any;
@Prop() item: any;
@Prop() item: ItemValue;
@Prop() index: any;
@Prop() hideLabel: boolean;
protected getModel(): Base {
return this.item;
}
get isAllSelected() {
return this.question.isAllSelected;
}
Expand All @@ -73,4 +84,4 @@ export class CheckboxItem extends Vue {
}
Vue.component("survey-checkbox-item", CheckboxItem);
export default CheckboxItem;
</script>
</script>
9 changes: 7 additions & 2 deletions src/vue/radiogroupitem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,20 @@
</template>

<script lang="ts">
import { ItemValue, Base } from "survey-core";
import Vue from "vue";
import { Component, Prop } from "vue-property-decorator";
import { BaseVue } from "./base";
@Component
export class RadiogroupItem extends Vue {
export class RadiogroupItem extends BaseVue {
@Prop() question: any;
@Prop() item: any;
@Prop() item: ItemValue;
@Prop() index: any;
@Prop() hideLabel: boolean;
protected getModel(): Base {
return this.item;
}
getLabelClass(item: any) {
return this.question.getLabelClass(item);
}
Expand Down

0 comments on commit c5e90a7

Please sign in to comment.