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

Typo when importing Idiomorph library in application.js #6

Closed
cavenk opened this issue Jan 25, 2024 · 1 comment
Closed

Typo when importing Idiomorph library in application.js #6

cavenk opened this issue Jan 25, 2024 · 1 comment

Comments

@cavenk
Copy link

cavenk commented Jan 25, 2024

There is a typo when configuring Idiomorph in application.js.
The key should be 'morphStyle' in camel case.
See screenshot below.
Screenshot 2024-01-25 at 12 00 27 PM

With the typo, this option is ignored and the default 'outerHTML' option is used.
This creates sometimes a problem with Turbo because when I press a link and I receive the response as turbo, Idiomorph will try to merge the new content with the old turbo frametag by comparing the attributes of the element. However, Turbo automatically adds and removes some attributes on the turbo frame tag like 'src' or 'completed' while Idiomorph is running and this creates an error because Idiomorph is not able to compare the attributes
Screenshot 2024-01-25 at 1 23 01 PM

If I set the morphStyle to 'innerHTML', there is another problem. The turbo frame tag is put inside of the original turbo frame tag and there is now multiple turbo frame tag with the same name
Screenshot 2024-01-25 at 1 24 54 PM

@cmer
Copy link
Owner

cmer commented Mar 14, 2024

I have fixed the typo. Thanks for letting me know!

Regarding the Idiomorph issue, it seems to be a bug on their end. I'm not sure what to do about it. I have already reported it, and found a workaround: bigskysoftware/idiomorph#41

@cmer cmer closed this as completed Mar 14, 2024
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

2 participants