Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not workin in modal #23

Open
MohammaddReza opened this issue Jan 2, 2024 · 4 comments
Open

Module not workin in modal #23

MohammaddReza opened this issue Jan 2, 2024 · 4 comments

Comments

@MohammaddReza
Copy link

I'm using wire-elements/modal module
simple-select works very well outside of this module but it doesn't work in the module

@sfc3lf44
Copy link

I have a similiar issue, although I'm not use wire-elements. If the simple-select is inside a child livewire component the population of options is not always working correctly. However, if I keep a second instance of simple-select on the parent page, the functionality seems to work more consistently.
When it's not working correctly inside a livewire child component, I am able to output the options variable and see the values. So I know it is getting passed correctly from the livewire component. But the id/name value pairs aren't shown in the select box. It is empty.
I suspect something is not getting initialized properly that is causing this behavior.

@ronald2wing
Copy link

I have the same issue.

@NikarashiHatsu
Copy link

I had the similar issue, not only with this package, but also livewire-mapbox as well. I guess there's some code within the Wire-element's Modal that causes the component not being initiated properly. I haven't found the exact cause, but I'd love to see if you guys having workarounds after those times.

@NikarashiHatsu
Copy link

Hi, I hope this issue is still relevant and can help you guys.
I found a workaround that works pretty well, but you have to:

  1. Publish the Wire Elements' vendor files.
  2. Publish the Simple Select's vendor files (although this is optional, but I recommend to do so since I made a lot of adjustments here).

Then, edit the resources/views/vendor/wire-elements-modal/modal.blade.php, add the @include('simple-select::components.script') just inside the <div> where it has the x-data="LivewireUIModal()" attribute.

Screenshot 2024-07-27 at 22 51 25

Enjoy your working component, and happy coding.

Screenshot 2024-07-27 at 22 54 42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants