-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Union type in :array does not work properly on type change #211
Comments
I will address this early next week. If you have time to put together a test/repro that will help 🙇 |
So we have tests for this behavior, and as far as I can tell it works, so I'll need to see some sample code or a reproduction to go any further with it. |
Hi. I have the exact same bug. I am stumped but it is probably me doing something stupid. It is the same as the OP, I have an array of union types and when I try and change type as per the tutorial on Union Forms, I get this error from forms.ex. |
Are you on the latest version of ash_phoenix and ash? Some fixes were made recently to both. |
I am on the latest release ash phoenix v2.1.2 I can invite you to my repo if that's going to help |
We can that, yes. Please be sure to provide very clear reproduction steps and/or a failing test illustrating the issue. |
Awesome. I will get a test case written after the weekend. |
Hey. I fixed this on my own. The issue I had was from following the examples on this page https://hexdocs.pm/ash_phoenix/union-forms.html. In this event handler:
The one issue I have now, is that if I have more than one item in the list of subforms, when I change the type of the first item, it changes the type of all subsequent items too. Although that's not really a blocker, I might just disable the type select field once a new subform has been added. I am not sure this is the optimal fix for this. |
Hm....this does still seem like something we should fix internally. Especially given that you aren't able to have a mixed list of types. If you have a chance to reproduce in a test that would be awesome :) |
im fallowing this guide: https://hexdocs.pm/ash_phoenix/union-forms.html
but my union type is in list. Im get error:
The text was updated successfully, but these errors were encountered: