Fix wire:navigate javascript component not working | Livewire 3

  Рет қаралды 12,349

Yelo Code

Yelo Code

Күн бұрын

Welcome to our livewire 3 course, in this course we will cover all the basis needed to build dynamic front end components using livewire. I show you guys how to fix a common issue when using wire:navigate.
Laravel 10 Course mentioned in the video:
• Laravel 10 Tutorial : ...
Course Playlist :
• Laravel Livewire 3 Cou...
Tailwind CDN :
tailwindcss.co...
Blade and PHP codes used :
gist.github.co...
Through out the course we will cover:
how to make components
Actions
Properties
Form Submission and Validation
Flash Messages
Tables and Pagination
File Uploads
Inline Components
Full page Components and Layouts
Events
Offline States
URL Query Parameters
Nesting Components
Navigate
Loading states, Lazy loading and placeholders
And more
Livewire 3 website :
livewire.larav...
Boostrap Documentation:
getbootstrap.c...
If you would like me to make more livewire videos, please let me know by liking the video and commenting what you like to learn next.
What is livewire:
Livewire is a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel. (Taken from Livewire Documentation)

Пікірлер: 97
@wevertonlotosport
@wevertonlotosport Жыл бұрын
I really like your channel cause you talk about problems that we will find when working on a project with real data, real features, real scenarios, projects that will be 100% deployed after finished. Not just a bunch of components, bloated with fake data.
@abdalkhalekchamkha3622
@abdalkhalekchamkha3622 Жыл бұрын
thats true
@yelocode
@yelocode Жыл бұрын
Thanks you watching, Glad the videos are helpful.
@Pururum
@Pururum 9 ай бұрын
Man, you save me hours of debugging. Thanks
@yelocode
@yelocode 9 ай бұрын
Great to hear that
@yelocode
@yelocode Жыл бұрын
Hey everyone, One thing I forgot to mention in the video is destroying or removing the old instance, depending on how the library works you may have to remove the old instance and then re-initialise it. Something to be aware of. Thanks for watching.
@abdalkhalekchamkha3622
@abdalkhalekchamkha3622 Жыл бұрын
If you can do short video on it will be great
@ilahazs
@ilahazs 10 ай бұрын
how to do the same thing in Bootstrap 5? I wondering how to reinitialize it sir.
@abrahammaleko6600
@abrahammaleko6600 Жыл бұрын
Your the best i was literally spending my sunday debugging why it was happening until i saw your videos, thanks man
@yelocode
@yelocode Жыл бұрын
Glad I could help
@ronaldngarombo1026
@ronaldngarombo1026 8 ай бұрын
I had removed wire:navigate from my project. Nice of you 👍
@momodjah-low6944
@momodjah-low6944 8 ай бұрын
This was what i've looking for...helped me a lot ..thanks
@js_caleb5976
@js_caleb5976 4 ай бұрын
Great help, It fixed my issue. It deserves a subscribe button. Love it
@yelocode
@yelocode 4 ай бұрын
Thanks for watching🙏
@parimal20
@parimal20 2 ай бұрын
Thanks man. I was debugging from many days but you gave perfect solution.👍👍
@onnewf9288
@onnewf9288 8 ай бұрын
thanks a lot, you saved my day, this was the solution i've looking for i'm also using the flowbites template and got the same issues
@josephajibodu2377
@josephajibodu2377 Ай бұрын
Thanks. Your video was very helpful.
@yelocode
@yelocode Ай бұрын
Glad it was helpful!
@samirmaharjan6437
@samirmaharjan6437 6 ай бұрын
I was having similar issue when i navigate to next page in pagination. This video really helped me Thanks
@adeonabule1517
@adeonabule1517 6 ай бұрын
Please how did you fix with pagination?
@samirmaharjan6437
@samirmaharjan6437 6 ай бұрын
@@adeonabule1517 I was having issues with select2. i just reinitialized the functions on wire:navigated..
@codewithSJM
@codewithSJM Ай бұрын
This is Amazing Man! stay blessed saved my day!🤗
@wesley68593
@wesley68593 Жыл бұрын
Thank you very much! That’s exactly what I was looking for! You solved my problem.
@yelocode
@yelocode Жыл бұрын
Great to hear that. Thanks for watching.
@giokuan2327
@giokuan2327 7 ай бұрын
Thank you for this info, fixed my swiper slide 🥰
@yelocode
@yelocode 5 ай бұрын
Glad it helped!
@lvltech
@lvltech 6 ай бұрын
Great awesome i was thiking i make a mistake but cool to know about, thanx.
@nibirahmed6469
@nibirahmed6469 11 ай бұрын
Thanks very much for the help, but I want to load the select2 on one particular page, how can I do that?
@Skaydi-X
@Skaydi-X Ай бұрын
but i use a template , i have many js files and js vendors, how can i fix it please
@rodrigoweiss5201
@rodrigoweiss5201 Жыл бұрын
You save my day!!! Thanks!!! 🥳
@yelocode
@yelocode Жыл бұрын
Happy to help!
@abdulrehmandar8541
@abdulrehmandar8541 7 ай бұрын
How do I fix these issues with Bootstrap 5? Is there any advice? I am using vuexy admin panal. I personally fixed it using alpine js.
@WEESPlayzZz
@WEESPlayzZz Жыл бұрын
How I thankyou for this help , you are the best big brother thanks so muchhh for the video ❤❤❤❤❤❤. It's help us alot .. keep growing 😊
@yelocode
@yelocode Жыл бұрын
Glad the videos are helpful. Thank you for watching. One thing I did not mention in the video is, you may need to destroy the old instance before reinitialising it again, depending on the library you are using.
@WEESPlayzZz
@WEESPlayzZz Жыл бұрын
@@yelocode Okie 👌
@abdalkhalekchamkha3622
@abdalkhalekchamkha3622 Жыл бұрын
You realy save me i was thinking when i want to go to a page that i use scripts on i need to reload it
@yelocode
@yelocode Жыл бұрын
Thanks for watching, glad it was helpful. Although depending on the library you are using, you may need to destroy the old instance before reinitialising it, I didn't mention that in the video.
@druganov962
@druganov962 6 ай бұрын
You can also solve this by using AlpineJS's 'x-init' directive. (At least this is how i did it) so first i make a listener for that event that AlpineJS calls, since i could not directly call functions in x-init that were not defined by Alpine. this will be in your scripts tag Alpine.data('properties', () => { return { initSelect() { initSelect2() }, } }) function initSelect2(){ Your init code here blablabla } and finally, just put this in your original select element: x-init="initSelect"
@nathanmwamba8840
@nathanmwamba8840 8 ай бұрын
Man you are the best, now i have a problem with the navigating you have said when you put that livewire:navigated then then you can visit pages without js problems but when i do that and i visit page 2 and on that page 2 when i hit refresh on my browser and go back to page 1 where I have put my inline js that contains the livewire:navigated the js is failing to load but when I have not refreshed the page everything is working properly
@MichaelJohnSamonte
@MichaelJohnSamonte Жыл бұрын
Hi, thanks. I encountered the same issue in pagination, but the wire: navigated is not triggered. Any thoughts? Thanks in advance.
@yelocode
@yelocode Жыл бұрын
Thanks for watching. I personally have not had this issue before, but here is how I would go about fixing it using one of below methods. 1 - try to use wire:ignore to prevent the dynamic element from being re-rendered on component updates 2 - try to move the dynamic element outside the component if possible 3 - dispatch a browser event when page changes and then do the same thing I did in the video. In your livewire component need to add the below method to listen for pagination page changes and dispatch an event: public function updatedPage($page) { $this->dispatch('pagination:updated'); } in your js or blade file listen for it and reinitialise your js element: document.addEventListener('pagination:updated', () => { console.log("pagination event"); }) I hope this can help solve your issue. Please do let me know if you find some other approach so I can let share with other viewers if they have a similar issue.
@arischannel8168
@arischannel8168 Жыл бұрын
for my template not working using this feature navigate livewire,always getting error javascript because crash with internal js template
@sabinmagar4152
@sabinmagar4152 Жыл бұрын
i have a question. We have reinitialised select2 and then we submit the button how to get that select field data after subject a form can we use wire:model or else. please help.
@samsamimf9
@samsamimf9 2 ай бұрын
I was suffering for this problem yesterday😀
@kreaweb-be
@kreaweb-be Жыл бұрын
Since I use wire:navigate the autofocus on the first input on the register and login pages stopped working. Any ideas? Thanks.
@yelocode
@yelocode Жыл бұрын
I didn't know this issue, existed, one easy solution could be to use alphine js: by adding x-init="$el.focus();" to the element you want to auto focus, seems a bit hacky though, maybe livewire team will add some update to trigger autofocus on page changes, or we may have to do it ourselves, v3 is quite new so still not sure what the best approach may be.
@kreaweb-be
@kreaweb-be Жыл бұрын
@@yelocode This works. But I agree, maybe wait for V3 to mature a bit more. Thanks.
@SunDev-c4s
@SunDev-c4s Жыл бұрын
Hi Yelo Code, im using laravel livewire 3 and bootstrap 5, could you please provide a hint on how to solve this issue. thank you in advance
@khairulazmi9174
@khairulazmi9174 11 ай бұрын
did you able to find any solution ?
@SunDev-c4s
@SunDev-c4s 11 ай бұрын
yes@@khairulazmi9174
@SunDev-c4s
@SunDev-c4s 11 ай бұрын
@@khairulazmi9174 thank you.
@ilahazs
@ilahazs 10 ай бұрын
@@khairulazmi9174 How to fix it bro?
@ilahazs
@ilahazs 10 ай бұрын
@@SunDev-c4s Hi, how did you fix it?
@osawereao
@osawereao 8 ай бұрын
God bless you a bundle. I need one more help please @YeloCode PROBLEM: I have livewire deleting records from a row (listed on a HTML table) and I want to be able to just remove that element on successful delete without having to redirect or refresh.
@angelfireful
@angelfireful 11 ай бұрын
🎉🎉🎉
@sangatcepat
@sangatcepat 6 ай бұрын
How about using preline? Please provide a tutorial. Thank you
@AhmadImam22
@AhmadImam22 Жыл бұрын
i have an issue with this navigate and flowbite too. i am using flowbite admin panel and when it in mobile screen, the burger button of the aside menu did'nt work. but when i reload the page, the burger is work perfectly. hope you can help me
@susharto
@susharto 11 ай бұрын
I also have the same problem, sir. have you found the solution?
@nerisonpitogo3717
@nerisonpitogo3717 8 ай бұрын
Saved me.
@yelocode
@yelocode 8 ай бұрын
Thanks for watching
@mohamedbarrah3439
@mohamedbarrah3439 10 ай бұрын
pls i have the same problem but with tailwind-Elements -- SideNav -- how to fix it all th ``` import './bootstrap'; import { Sidenav, initTE, } from "tw-elements"; document.addEventListener('livewire:navigated', () => { console.log('Hello World from your main file!'); initTE({ Sidenav }); }); ``` but this is not working
@lfan_tv
@lfan_tv Жыл бұрын
Another problem is when creating datatable using flowbite and livewire3, it cannot show the modal if I add wire:click in the button tag
@yelocode
@yelocode Жыл бұрын
Do you have wire:click on the same button that opens the modal?
@lfan_tv
@lfan_tv Жыл бұрын
@@yelocode ya I already add the wire:click on the button tag
@achrizal3545
@achrizal3545 10 ай бұрын
how about with vite js to import module Swiper js
@galuhpradipta2705
@galuhpradipta2705 Жыл бұрын
Thanks!
@yelocode
@yelocode Жыл бұрын
Thanks for watching
@stackdeveloper7818
@stackdeveloper7818 Жыл бұрын
sir kindly tel me simple bootstrap 4 how can use init because its not work flowinit()
@mahmoudherbawi1844
@mahmoudherbawi1844 7 ай бұрын
did you got the solution for that?
@Harshad-h1p
@Harshad-h1p 8 ай бұрын
thanks
@hyuugasenpai7551
@hyuugasenpai7551 9 ай бұрын
can anyone help me, I have implemented what has been done in the video, the code works, for example in dropdowns and so on,but I still experience the bug that the button cannot be clicked on the navbar button, can anyone help me?
@globetrotterxxl7440
@globetrotterxxl7440 Жыл бұрын
good to know! Shouldn't we call $(...).select2('destroy'); before initializing it again and again to avoid a memory leak?
@yelocode
@yelocode Жыл бұрын
really good point, I forgot to mention that, probably have to that depending on how the library works. Although I don't think above code will work, since on the new page the DOM has changed. Probably would have to use livewire:navigating event to destroy it before we change the page.
@HamadAbdulla_7
@HamadAbdulla_7 Жыл бұрын
thank you
@yelocode
@yelocode Жыл бұрын
Thanks for Watching
@devkumarverma7376
@devkumarverma7376 7 ай бұрын
hii sir can you please tell me about the exact same solution using liveiwre 2 ?
@samirmaharjan6437
@samirmaharjan6437 6 ай бұрын
livewire2 doesnot has wire:navigated so, we need to emit extra event each time and on those event reinit the function.
@eramitgupta271
@eramitgupta271 Жыл бұрын
When I am uploading files, like photos, and videos, select 2 is not working after that, how do I fix it? please help me
@yelocode
@yelocode Жыл бұрын
Uploading files may be reloading your livewire component. You may need to either look into wire:ignore or try to re initialise your select2 element on every update by adding a js event listener for it
@eramitgupta271
@eramitgupta271 Жыл бұрын
@@yelocode I am not able to understand, can you tell me, data is not getting saved after.
@eramitgupta271
@eramitgupta271 Жыл бұрын
@@yelocode wire:ignore I need a video on this, I am having a lot of trouble, please help.
@yelocode
@yelocode Жыл бұрын
@@eramitgupta271 I will try to cover wire:ignore on the upcoming livewire videos
@eramitgupta271
@eramitgupta271 Жыл бұрын
@@yelocode thank you 😊❤️
@brandonbroga8983
@brandonbroga8983 Жыл бұрын
I’m trying to get FullCalendar to re init… But it wont
@microfinancesystem135
@microfinancesystem135 3 ай бұрын
Thank you help me
@jobianstechie
@jobianstechie 11 ай бұрын
Please help me solve bootstrap navbar stopped working after coming back to recent page
@mahmoudherbawi1844
@mahmoudherbawi1844 7 ай бұрын
did you solve it?
@jobianstechie
@jobianstechie 7 ай бұрын
@@mahmoudherbawi1844 no
@ilahazs
@ilahazs 10 ай бұрын
How to reinitialize bootstrap 5 in livewire 3?
@mahmoudherbawi1844
@mahmoudherbawi1844 7 ай бұрын
did you got a solution for that?
@samirmaharjan6437
@samirmaharjan6437 6 ай бұрын
i got the same issue
@ilahazs
@ilahazs 6 ай бұрын
I dont, but for example, i'm mixed alpine js and bootstrap dropdown for open dropdown
@cartmellTV
@cartmellTV 9 ай бұрын
If anyone is running into with const and let constantly being declared, again, I just changed everything to var and didn't have anymore issues
@JamesAutoDude
@JamesAutoDude 10 ай бұрын
I'm starting to think wire:navigate just isn't worth it, and maybe I should use something else other than livewire :/ I'm having an issue where some pages reload the whole dom (the page reloads), while others don't... and other weird behavior.
@samirmaharjan6437
@samirmaharjan6437 6 ай бұрын
agree
Wire:navigate (SPA) | Laravel Livewire 3 for Beginners EP20
11:22
Человек паук уже не тот
00:32
Miracle
Рет қаралды 1,9 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 2,8 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,2 МЛН
Full Page Components | Laravel Livewire 3 for Beginners EP15
14:25
Laravel Livewire Dependent Dropdown with Select2
15:04
Tony Xhepa
Рет қаралды 7 М.
SHADCN UI IS OVERRATED | TRY THIS
7:20
Harshith Vaddiparthy
Рет қаралды 2,1 М.
13 FREE Livewire Components I've Found
6:44
Laravel Daily
Рет қаралды 24 М.
Sweet Alerts | Laravel Livewire 3 for Beginners EP26
10:54
Yelo Code
Рет қаралды 7 М.
Reusable Bootstrap Modal  | Laravel Livewire 3 from Scratch
42:45
Человек паук уже не тот
00:32
Miracle
Рет қаралды 1,9 МЛН