How to mount alphine functions after DOM changes? #4584
Unanswered
oliver-modernmc
asked this question in
1. Help
Replies: 1 comment 2 replies
-
You should use Alpine.data to define the component script, and ensure that the script run and runs BEFORE you add the other dom to the page. Or deliberately delay it and manually initialize it. You basically just have a race condition. assuming your script tag is running at all. realistically, you could just also include the data component from the get go. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Basically this is the whole code.
This is used inside the table to display a dropdown options with search filter.
Initially the table is blank at first (due to preset date filter). I have to adjust the date filter in order to fill-up the table.
The problem is this component doesn't work correctly (due to dom changes, the functions doesn't get remounted).
There will be no dropdown list (but I can see that there are values on json_encode.
Is there a way for me to rerender/remount alpine functions due to dom update?
Beta Was this translation helpful? Give feedback.
All reactions