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

FORMS-12148 ensuring different radio button group elements have diffe… #1013

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -75,6 +75,8 @@
super.setModel(model);
let widgets = this.widget;
widgets.forEach(widget => {
widget.name = model.id;
widget.dataset.afName = model.name;
widget.addEventListener('change', (e) => {
this._model.value = e.target.value;
});
Expand Down
Expand Up @@ -43,7 +43,7 @@
<label class="cmp-adaptiveform-radiobutton__option-label"
title="${radioButton.tooltipVisible ? '' : radioButton.tooltipText}">
<input type="radio"
name="${radioButton.name}"
name="${radioButton.id}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cases are failing due to this change, shouldn't name be the radio button's name ? Can you also add repeatable test case in the existing repeatable test suite ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Different radio button in the same group should have same names but not across the different groups.
Radio Button Groups can have same name across panels/repeating panels, hence we should use id since id is unique for different groups

class="cmp-adaptiveform-radiobutton__option__widget"
value="${item.toString}"
disabled="${!radioButton.enabled || radioButton.readOnly}"
Expand Down