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

template x-if support #1

Open
josh-tt opened this issue Jul 23, 2023 · 1 comment
Open

template x-if support #1

josh-tt opened this issue Jul 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@josh-tt
Copy link

josh-tt commented Jul 23, 2023

Hi there, just checking out your plugin. Nice! I've been working on something similar recently (though without user configurable templates) and have found that setting x-init with next tick seems to work for getting transitions working within an x-if/for.

Is that something you might consider adding as it seems that I can't get the transitions working within the template with yours.

The trick that worked for me was doing this when applying transition attributes:
element.setAttribute('x-init', $nextTick(() => {${showString} = true}));

@iniznet
Copy link
Owner

iniznet commented Jul 26, 2023

Hi, sorry for the late reply, been busy recently.

That made me realize that I didn't test the plugin within a template x-if/for, I apologize for the inconvenience.

I think that's a viable workaround until we come up with a proper fix. I will try to debug it when I'm free next month, or you can make a PR for this issue. I would appreciate that.

@iniznet iniznet added the bug Something isn't working label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants