Skip to content

Commit

Permalink
Vue2&Vue3 - The None item is duplicated when the separateSpecialChoic…
Browse files Browse the repository at this point in the history
…es option is enabled fix #7126 (#7128)
  • Loading branch information
andrewtelnov committed Oct 12, 2023
1 parent 71232b7 commit a5080a3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/survey-vue3-ui/src/Radiogroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
<survey-radiogroup-item
v-if="!question.hasColumns && !question.blockedRow"
v-for="(item, index) in question.visibleChoices"
v-for="(item, index) in question.bodyItems"
:key="item.value"
:class="question.getItemClass(item)"
:question="question"
Expand Down
4 changes: 2 additions & 2 deletions src/vue/radiogroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>
<survey-radiogroup-item
v-if="!question.hasColumns && !question.blockedRow"
v-for="(item, index) in question.visibleChoices"
v-for="(item, index) in question.bodyItems"
:key="item.value"
:class="getItemClass(item)"
:question="question"
Expand Down Expand Up @@ -91,4 +91,4 @@ export class Radiogroup extends QuestionVue<QuestionRadiogroupModel> {
}
Vue.component("survey-radiogroup", Radiogroup);
export default Radiogroup;
</script>
</script>
20 changes: 20 additions & 0 deletions testCafe/questions/radiogroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,24 @@ frameworks.forEach(framework => {
.expect(Selector(".sv-string-viewer").withText(oldOtherText).count).eql(0)
.expect(Selector(".sv-string-viewer").withText(newOtherText).count).eql(2);
});
test("showNoneItem&separateSpecialChoices", async t => {
const currentJson = {
elements: [
{
type: "radiogroup",
separateSpecialChoices: true,
showNoneItem: true,
name: "car",
choices: [
"item1",
"item2",
"item3"
]
}
]
};
await initSurvey(framework, currentJson);
await t
.expect(Selector(".sv-string-viewer").withText("None").count).eql(1);
});
});

0 comments on commit a5080a3

Please sign in to comment.