Prefilling a Field in "Create New Option" Modal of a Select Component in FilamentPHP**

I want to prefill a field in the "create new option" modal, Here's the code I've tried, but it doesn't seem to be effective:

<?php

use App\Filament\Actions\CreateProductInPaddle;
use App\Filament\Resources\ProductResource;
use Filament\Forms\Components\Select;
use Filament\Forms\Form;

Select::make('product_id')
    ->relationship('product', 'title')
    ->placeholder('No products available')
    ->searchable()
    ->createOptionForm(function (Form $form) {
        $form->fill(["title" => "prefilled"]);
        return ProductResource::form($form);
    })
    ->createOptionUsing(fn($data, CreateProductInPaddle $action) => $action($data))
    ->allowHtml()
    ->required(),

Is there a proper way to prefill data in this scenario with Filament, or is this not supported yet?
Any suggestions or code examples would be greatly appreciated.
Was this page helpful?