live() deletes my cropper instance, custom field
I made a form field that incorporates Cropper.js to select part of an image and give back the coordinates to four other input form fields. This works perfectly so far, but after the very first update to the state, the Cropper instance seems to completely disappear... When removing live(), this doesn't happen, but obviously the other four form fields are no longer being updated.
Does anyone know what the issue is here? Thank you!
image 1: without live()
image 2: with live(), cropper instance dissappeared
Field:
Class:
Blade:
Script:
Solution:Jump to solution
Okay, adding to the x-dynamic-component seems to work in reinitializing the script! Now I just need to set it to the correct position 😄
2 Replies
Ah, I can see now in the docs, live() basically rerenders the HTML, so I can only guess this is without the scripts... That's at least part of the solution.
Solution
Okay, adding to the x-dynamic-component seems to work in reinitializing the script! Now I just need to set it to the correct position 😄