-
-
Notifications
You must be signed in to change notification settings - Fork 22
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 with double nested forms #14
Comments
Nice catch! Can you open a PR with examples and the fix? |
You have two separate relations, which yes, needs two separate setups. The bug I'm talking about is when you need to have deeply nested forms :) |
I ran into this issue as well, but i noticed it where label elements were linking to the first sibling's inputs. What I noticed was that when you have nested |
I think there's bug when using in a form with multiple nested associations. Like a Survey -> Questions -> Answers situation for example.
When clicking Remove the code here https://github.com/stimulus-components/stimulus-rails-nested-form/blob/master/src/index.ts#L34 will grab the first _destroy input which in a double nested situation might be wrong (depends on where you put the remove button) and you'll end up removing a nested child instead of the parent child sometimes.
If the line instead is written like
everything works but the precludes that the input element is a direct descendent of the wrapper class. Not sure what the ideal fix would be.
The text was updated successfully, but these errors were encountered: