Azka
Azka
FFilament
Created by Azka on 9/10/2024 in #❓┊help
Having TextInput in CreateAction breaks closing modals by clicking outside
Hi! I have a livewire-component where i have built a filament form. Clicking the "Add new"-button in the top opens a modal, and i can close it by clicking escape, close-button or the X in the top right corner so thats great. But i cant make it close by clicking outside the modal - this should be standard behavior from the Filament docs. The delete-modal works as expected and closes when i click outside it. Here is the code:
->headerActions([
CreateAction::make()
->label(__('wedding_page.add_gift'))
->modalHeading(__('wedding_page.add_gift'))
->modalSubmitActionLabel(__('wedding_page.create_gift'))
->form([
TextInput::make('title')
->required()
->label(__('wedding_page.gift_title')),
TextInput::make('description')
->label(__('wedding_page.gift_description')),
TextInput::make('link')
->url()
->label(__('wedding_page.gift_link')),
FileUpload::make('image')
->image()
->disk('public')
->directory('wedding_gifts')
->label(__('wedding_page.gift_image'))
->imageEditor()
->columnSpanFull(),
])
->using(function (array $data): WeddingGift {
$gift = $this->publicPage->weddingGifts()->create($data);
return $gift;
}),
]);
->headerActions([
CreateAction::make()
->label(__('wedding_page.add_gift'))
->modalHeading(__('wedding_page.add_gift'))
->modalSubmitActionLabel(__('wedding_page.create_gift'))
->form([
TextInput::make('title')
->required()
->label(__('wedding_page.gift_title')),
TextInput::make('description')
->label(__('wedding_page.gift_description')),
TextInput::make('link')
->url()
->label(__('wedding_page.gift_link')),
FileUpload::make('image')
->image()
->disk('public')
->directory('wedding_gifts')
->label(__('wedding_page.gift_image'))
->imageEditor()
->columnSpanFull(),
])
->using(function (array $data): WeddingGift {
$gift = $this->publicPage->weddingGifts()->create($data);
return $gift;
}),
]);
` If i remove the ->form code and the TextInput etc that follows in the code so i just have a empty modal, then i can close it by clicking outside the modal, so somethings seems to break when i have forms in the modals?
5 replies
FFilament
Created by Azka on 7/2/2024 in #❓┊help
6 digits in year usingDateTimePicker & DatePicker
When entering the date by typing on the keyboard, i can enter 202407 before it jumps over to the month "section" of the field. Anyone knows how to solve this? Here is an example of the code:
Forms\Components\DateTimePicker::make('ends_at')
->required()
->hidden(fn (Forms\Get $get) => $get('is_all_day'))
->seconds(false)
->format('Y-m-d H:i')
->displayFormat('Y-m-d H:i'),
Forms\Components\DatePicker::make('date')
->required()
->visible(fn (Forms\Get $get) => $get('is_all_day'))
->format('Y-m-d')
->displayFormat('Y-m-d'),
Forms\Components\DateTimePicker::make('ends_at')
->required()
->hidden(fn (Forms\Get $get) => $get('is_all_day'))
->seconds(false)
->format('Y-m-d H:i')
->displayFormat('Y-m-d H:i'),
Forms\Components\DatePicker::make('date')
->required()
->visible(fn (Forms\Get $get) => $get('is_all_day'))
->format('Y-m-d')
->displayFormat('Y-m-d'),
`
9 replies