F
Filament14mo ago
Damien

TextInput weird behaviour and not rendering all inputs

I am trying to add a few TextInputs for a Create action. For some reason, the 3rd element is always missing and I have to duplicate it for something to appear where it should be, below is my code and a screenshot of what is being rendered:
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('first_name'),
TextInput::make('last_name'),
TextInput::make('email'),
TextInput::make('email'),
TextInput::make('phone'),
TextInput::make('mobile'),
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('first_name'),
TextInput::make('last_name'),
TextInput::make('email'),
TextInput::make('email'),
TextInput::make('phone'),
TextInput::make('mobile'),
]);
}
And in the picture is what it renders.
No description
6 Replies
jonquihote
jonquihote14mo ago
I think the reason why one of your email input is not rendering because your email input are using the same identifier. if you try to use email_1 and email_2 both should render just fine.
Damien
DamienOP14mo ago
sadly not, if I remove one, then 0 appear or if i change it to be a different value, it does not appear like so
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('first_name'),
TextInput::make('last_name'),
TextInput::make('email_banana'),
TextInput::make('email'),
TextInput::make('phone'),
TextInput::make('mobile'),
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('first_name'),
TextInput::make('last_name'),
TextInput::make('email_banana'),
TextInput::make('email'),
TextInput::make('phone'),
TextInput::make('mobile'),
]);
}
Damien
DamienOP14mo ago
No description
Damien
DamienOP14mo ago
I thought it could have been a bug so i setup a new project and tried to repro it but it doesn't seem do it. so for some reason, this one has the issue only.
jonquihote
jonquihote14mo ago
It is weird indeed and if your attempt at repro doesn't seem to work, i doubt i can help you as well. Sorry about that.
Damien
DamienOP14mo ago
That's fine, if I stick it in a wizard, it shows the elements correctly. I just don't know how I feel about a page wizard vs a wizard inside of a modal and I cannot seem to figure out how to get it to show as a modal when clicking create at the moment.
Want results from more Discord servers?
Add your server