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

When form validations fail, Add nested button behaviour is not woking. #47

Closed
tirnavali opened this issue Feb 22, 2022 · 9 comments
Closed

Comments

@tirnavali
Copy link

I think this problem is related with turbo but i can not solve it.

Ekran.Kaydi.2022-02-22.mov
@arielj
Copy link
Owner

arielj commented Mar 28, 2022

can you share a test app to reproduce this? the code listens to the turbo:load event, maybe this is fireing a different event?

I think I have to move the event listener to the document element instead of querying all the elements, that way it should work for any element that is added after too, an app to reproduce this would be realyl useful because I did some tests with turbo but I can't seem to reproduce this exact case

@arielj
Copy link
Owner

arielj commented Mar 28, 2022

hey @tirnavali can you try using the gem from the github repo instead of rubygems/yarn? https://github.com/arielj/vanilla-nested#installation (check the alternate code using arielj/vanilla-nested as the source if you are using both the rails gem and the yarn package)

I pushed a refactor that should fix your problem, I would like to get some confirmation if it worked for you before making a release

@alviandf
Copy link

yeah I have that issue too

@arielj
Copy link
Owner

arielj commented Apr 18, 2022

@alviandf can you try with the latest commit from github instead of the version uploaded to rubygems and npm? I think it should be fixed with my latest changes, I would like to have confirmation before making a release

check the installation section in the readme on how to use github for both yarn and bundler

@snjhyrglr
Copy link

@arielj is it available for simple forms?

@arielj
Copy link
Owner

arielj commented Jun 10, 2022

hey @snjhyrglr, the way this works is it will render whatever you put in the partial for the nested fields, I haven't tried specifically with simple form but I see no reason for that to not work since once rails processes the partial it's just html that gets added as a data attribute

@snjhyrglr
Copy link

@arielj thanks. already found out how to use it in simple forms.

@lenilsonjr
Copy link

@arielj I faced the same issue and pulling from main solved it, thanks for the fix!

Also, I noticed a small JS error being generated in the console and sent a PR for it here: #61

@arielj
Copy link
Owner

arielj commented Jul 17, 2022

Released version 1.6.2 that fixes this issue in both npm and rubygems so no need to use the main branch anymore, closing.

@arielj arielj closed this as completed Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants