Cannot find parent element in DOM tree containing attribute: [wire:id].

I have a search method on my livewire component, and i have custom fields that i load on mount method depending on selected type. custom fields loads and render well. however when i search by using updateSearchString this issue comes out,

image

Bit hard only seeing your partial form, but I would add wire:key="" to each of your form components

inside the quotes put the unique reference to the field, eg 34 if that is an id for the dynamic form component

wire:key="{{ $component->id }}"

The custom_fields are dynamic (forms fields) load depending on the selected type.

And reusable, separate from livewire (blade custom fields).

My trick was to initialize the livewire component without choosing any default field form type.

But this just solved on this specific situation. It’s not a proper solution.

That was the super polite way of saying nobody will be able to help you if you don’t post your component view code. There are multiple things that can cause dom diffing, div tags out of whack, needing to key looped items, some bug currently with id’s, etc. That’s why there’s a whole page dedicated to it in the docs.