I run in troubles with Livewire where the hidden input don't get the value from the user input. So I used your trick about refresh and it works.
But, and maybe because, the hidden input where the wire:model is can't sync with Livewire when it's updated by JS.
So I had to add theses line to get it works in my x-init :
initPhone() { let vm = this; document.querySelector("#phone").addEventListener('telchange', function(e) { if(e.detail.valid) { vm.phone = e.detail.validNumber; } }); }
Hello,
First, thanks for this plugin.
I run in troubles with Livewire where the hidden input don't get the value from the user input. So I used your trick about refresh and it works.
But, and maybe because, the hidden input where the wire:model is can't sync with Livewire when it's updated by JS.
So I had to add theses line to get it works in my x-init :
initPhone() { let vm = this; document.querySelector("#phone").addEventListener('telchange', function(e) { if(e.detail.valid) { vm.phone = e.detail.validNumber; } }); }
And phone: @entangle('phone').
Is there a better way ?
Have a nice day. Arnaud