rawilk / laravel-form-components

Form components built for Tailwind & Livewire.
https://randallwilk.dev/docs/laravel-form-components
MIT License
397 stars 44 forks source link

V8 Livewire 3 Compatibility? #136

Open gRoberts84 opened 1 year ago

gRoberts84 commented 1 year ago

Laravel Form Components Version

v8.1

Laravel Version

v10.22.0

Alpine Version

3.13

Bug description

When setting up on a fresh project, it appears the Morph Markers are not working for the form components, where as they did fine with Livewire 2.

<div class="mb-2">
    <x-label>First Name</x-label>
    <x-input name="forename" />
</div>
image
<div class="mb-2">
        <!-- __BLOCK__ --><label class="form-label" :id="$id('fc-label')" id="fc-label-1">
    <!-- __BLOCK__ -->        First Name
     <!-- __ENDBLOCK__ -->
</label>
 <!-- __ENDBLOCK__ -->
        <div class="form-text-container  form-input--md   ">
    <!-- __BLOCK__ --> <!-- __ENDBLOCK__ -->

    <input class="form-text" <!--="" __block__="" --=""> name="forename"  <!-- __ENDBLOCK__ -->
<!-- __BLOCK__ --> id="forename"  <!-- __ENDBLOCK__ -->
<!-- __BLOCK__ --> <!-- __ENDBLOCK__ -->

        type="text"

            /&gt;

    <!-- __BLOCK__ --> <!-- __ENDBLOCK__ -->

</div>
    </div>

When downgrading to V7, it renders but still displays the Morph Markers.

Steps to reproduce

Relevant log output

No response

joserick commented 1 year ago

Same problem. Compatibility is required with Livewire 3

Updated: In base to https://livewire.laravel.com/docs/morphing#injecting-morph-markers Work if in config/livewire.php change 'inject_morph_markers' to false.

'inject_morph_markers' => false,

Note: You need to run "php artisan view:clear" to see the changes.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.

magarrent commented 6 months ago

Hey! The components CSS failed before I added those lines to tailwind.config.js. For the record, I upgraded from Livewire 2 to 3

// Make sure you add these lines
"./vendor/rawilk/laravel-form-components/src/**/*.php",
"./vendor/rawilk/laravel-form-components/resources/**/*.php",
"./vendor/rawilk/laravel-form-components/resources/js/*.js",

Before: image

After: image