F
Filament3mo ago
SOIX

Form doesnt work with builder blocks and blockPreviews

Two issues: 1. If preview view has form element, create button doesn't work. Even tho the form is removed from html. (But create another button works) 2. If we add multiple blocks with forms, second forms are not even removed from html. (pic) Reproduction repository https://github.com/InfinityXTech/filament-dynamic-fields-issue/tree/builder-block-issue Used code:
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Builder::make('content')
->blockPreviews()
->blocks([
Forms\Components\Builder\Block::make('test')
->schema([
Forms\Components\TextInput::make('title')
->default('Test')
->required()
])
->preview('test'),
])
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Builder::make('content')
->blockPreviews()
->blocks([
Forms\Components\Builder\Block::make('test')
->schema([
Forms\Components\TextInput::make('title')
->default('Test')
->required()
])
->preview('test'),
])
]);
}
And test.blade.php
<div class="w-full mt-8 bg-transparent border rounded-md lg:max-w-sm dark:border-gray-700 focus-within:border-blue-400 focus-within:ring focus-within:ring-blue-300 dark:focus-within:border-blue-400 focus-within:ring-opacity-40">
<form class="flex flex-col lg:flex-row">
<input type="email" placeholder="email" class="flex-1 h-10 px-4 py-2 m-1 text-gray-700 placeholder-gray-400 bg-transparent border-none appearance-none dark:text-gray-200 focus:outline-none focus:placeholder-transparent focus:ring-0" />

<button type="button" class="h-10 px-4 py-2 m-1 text-white transition-colors duration-300 transform bg-blue-500 rounded-md hover:bg-blue-400 focus:outline-none focus:bg-blue-400">
Join
</button>
</form>
</div>
<div class="w-full mt-8 bg-transparent border rounded-md lg:max-w-sm dark:border-gray-700 focus-within:border-blue-400 focus-within:ring focus-within:ring-blue-300 dark:focus-within:border-blue-400 focus-within:ring-opacity-40">
<form class="flex flex-col lg:flex-row">
<input type="email" placeholder="email" class="flex-1 h-10 px-4 py-2 m-1 text-gray-700 placeholder-gray-400 bg-transparent border-none appearance-none dark:text-gray-200 focus:outline-none focus:placeholder-transparent focus:ring-0" />

<button type="button" class="h-10 px-4 py-2 m-1 text-white transition-colors duration-300 transform bg-blue-500 rounded-md hover:bg-blue-400 focus:outline-none focus:bg-blue-400">
Join
</button>
</form>
</div>
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server