Can't have two LWA in the same page. #37
-
If they are stacked, do to z index or something, the options in the top input will go under the lower input and not be seen. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
@inmanturbo hmm strange, it works fine for me. ![]() Can you share a screenshot of the issue in your browser and also share your blade view (in code blocks) so I can have a look? Also which version you are using of Livewire and this package? Thanks! |
Beta Was this translation helpful? Give feedback.
-
It's a Jetstream app without much customization. Pretty fresh, latish releases. Livewire ^v3. They are wrapped in input groups just like the ones Jetstream uses in its stock forms. I'll post screenshots and markup soon. |
Beta Was this translation helpful? Give feedback.
-
@joshhanley here is the screenshot and markup <div class="col-span-6 sm:col-span-4">
<x-label for="contact" value="{{ __('Contact') }}" />
<div @contact-name-add-new.window="$wire.createContact($event.detail)">
<x-lwa::autocomplete
name="contact-name"
wire:model-text="contactName"
wire:model-id="contactId"
wire:model-results="contacts"
:options="[
'text'=> 'display_name',
'allow-new'=> 'true',
]"
/>
</div>
<x-input-error for="contactName" class="mt-2" />
</div>
<div class="col-span-6 sm:col-span-4">
<x-label for="company" value="{{ __('Company') }}" />
<div @company-name-add-new.window="$wire.createCompany($event.detail)">
<x-lwa::autocomplete
name="company-name"
wire:model-text="name"
wire:model-id="companyId"
wire:model-results="companies"
:options="[
'text'=> 'name',
'allow-new'=> 'true',
]"
/>
</div>
<x-input-error for="name" class="mt-2" />
</div> "require": {
...
"joshhanley/livewire-autocomplete": "^2.1",
"laravel/framework": "^11.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.9",
"livewire/livewire": "^3.0",
...
}, |
Beta Was this translation helpful? Give feedback.
-
Notice there's not much support for dark mode either, but that's less a bug topic and more an ideas one. I do love the package. It's simple and lightweight. Even the most basic apps are helped along quite by its use. Not every project warrants a filament deep dive! |
Beta Was this translation helpful? Give feedback.
@inmanturbo thanks, I will test it out when I get the chance. I just realised that adding the autocomplete components to your
tailwind.config.js
isn't documented, so it's likely that Tailwind isn't including the z-index.Try adding this to your
tailwind.config.js
and rebuild: