Jquery focus()
Hi,
I've got a livewire component that worked OK in Livewire 2 but is somehow broken since V3.
The use case is as following :
I've got an livewire html component wich contain a simple html search form that is hidden on first render (display : none).
A wire button toggle the boolean that display this form. This livewire function also emit an event that is catch in the html component to set the focus in the search input that would be shown.
The issue is that the js catch the event before the component is re-render and also before the input is shown in the page (display: block).
The $("#myId").focus(); does not work because the input is not display on the page, so i think.
To test, i set an alert('XX'') in the js that catch the event, it is displayed and i can see that the html component is not re-render yet. As soon as i closed the alert, the html is refreshed.
I also test to wrap the .focus() in a setTimeout() and it worked, but i think this is not the best way to handle this case.
I'm pretty sure that this setup worked before in livewire V2.
Any idea ?
Thx for your help
Please or to participate in this conversation.