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

Toggle group not showing initial form control value #408

Open
1 of 2 tasks
marcindz88 opened this issue Nov 2, 2024 · 1 comment · May be fixed by #482
Open
1 of 2 tasks

Toggle group not showing initial form control value #408

marcindz88 opened this issue Nov 2, 2024 · 1 comment · May be fixed by #482
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@marcindz88
Copy link

Please provide the environment you discovered this bug in.

Angular: 18.2
@spartan-ng/ui-tooltip-brain: "0.0.1-alpha.356"

Which area/package is the issue in?

toggle

Description

Hi, I have encountered an error with the toggle group, if I set the initial form value it is not shown in a group of toggles until the user changes the choice.

I think that the issue is caused by the fact that, the toggle are not yet rendered and hence _setSelectionByValue exits and later when the toggles appear on ngAfterContentInit their state is not updated.

It could also be possible to set the toggle state in a BrnToggleDirective constructor from the injected ToggleGroupProvider.

I have found a workaround of setting state via the toggle state input, but would like to fix this properly in a group implementation

Please provide the exception or error you saw

No response

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@marcindz88 marcindz88 added the bug Something isn't working label Nov 2, 2024
@goetzrobin goetzrobin added the help wanted Extra attention is needed label Nov 7, 2024
@goetzrobin
Copy link
Collaborator

It seems like you are willing to work on this and open a PR with a fix?
Any help you need from my side?

@goetzrobin goetzrobin assigned goetzrobin and unassigned marcindz88 Nov 14, 2024
goetzrobin added a commit that referenced this issue Nov 14, 2024
goetzrobin added a commit that referenced this issue Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants