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

bug: Nested checkboxes inside a radio group influences the radio group selection #18248

Closed
Kernolsie opened this issue May 10, 2019 · 2 comments · Fixed by #18976
Closed

bug: Nested checkboxes inside a radio group influences the radio group selection #18248

Kernolsie opened this issue May 10, 2019 · 2 comments · Fixed by #18976
Assignees
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@Kernolsie
Copy link

Kernolsie commented May 10, 2019

Bug Report

Ionic version:
Yes 4.anything
[x] 4.x

Current behavior:
Nested checkboxes inside a radio group influences the radio group selection.

Expected behavior:
I have a nested selection list:
Radio1
Checkbox1
Checkbox2
Radio2
etc.
The checking of the checkboxes should have no influence on the radio selection. How do I encapsulate the checkboxes?

Steps to reproduce:
Make a radio group with a few radio options, inside the radio group make a few checkboxes. See how the radio selection changes as you select a nested checkbox

Related code:
https://stackblitz.com/edit/ionic-4-template-8bbqgj
I have put the output of the radio selection at the bottom of the home page. You'll see that as you click a checkbox then the radio-selection string becomes "on" as default

<ion-list>
		<ion-radio-group [(ngModel)]="radioOption">
			<ion-item>
        <ion-radio slot='start' value="option1"></ion-radio>
            <ion-label>Radio1</ion-label>
			</ion-item>
      <ion-item class='indent'>
        <ion-checkbox slot='start' [(ngModel)]='checkboxValue1' (ionChange)='checkBoxChanged()'> </ion-checkbox>
            <ion-label>Checkbox1</ion-label>
			</ion-item>
      <ion-item  class='indent'>
        <ion-checkbox slot='start' [(ngModel)]='checkboxValue2' (ionChange)='checkBoxChanged()'> </ion-checkbox>
            <ion-label>Checkbox2</ion-label>
			</ion-item>
      	<ion-item>
        <ion-radio slot='start' value="option2"></ion-radio>
            <ion-label>Radio2</ion-label>
			</ion-item>
		</ion-radio-group>
	</ion-list>
@ionitron-bot ionitron-bot bot added the triage label May 10, 2019
@Kernolsie Kernolsie changed the title bug: bug: Nested checkboxes inside a radio group influences the radio group selection May 10, 2019
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels May 10, 2019
@ziftytodd
Copy link

This problem isn't limited to checkboxes. I have the same issue with ion-input nested inside an ion-radio. Whatever is typed into the ion-input becomes the value for the ion-radio-group, despite having different formControlName set on the ion-input and the ion-radio-group.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 5, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants