Maxime
Maxime
FFilament
Created by Maxime on 11/20/2024 in #❓┊help
element.requestFullscreen() inside a Filament modal
Hello, i want to requestFullscreen an element inside a filament modal, but it closes the modal automatically. Any idea on how to fix that ? My action :
Tables\Actions\Action::make('view')
->label(__('View'))
->icon('heroicon-o-eye')
->color('info')
->modalHeading(fn($record) => __('Scan') . ' - ' . $record->done_at->translatedFormat('d F Y, H:i'))
->infolist([
Infolists\Components\ViewEntry::make('path')->view('filament.infolists.entries.scan-viewer')
])
->modalSubmitAction(false)
->modalCancelAction(false),
Tables\Actions\Action::make('view')
->label(__('View'))
->icon('heroicon-o-eye')
->color('info')
->modalHeading(fn($record) => __('Scan') . ' - ' . $record->done_at->translatedFormat('d F Y, H:i'))
->infolist([
Infolists\Components\ViewEntry::make('path')->view('filament.infolists.entries.scan-viewer')
])
->modalSubmitAction(false)
->modalCancelAction(false),
The view :
<div x-data="{
toggleFullscreen() {
this.$refs.test.requestFullscreen();
}
}">
<h1>Testing</h1>

<button @click="toggleFullscreen">Go Fullscreen</button>

<div x-ref="test" class="h-96 w-96 bg-red-400">
- my fullscreen element
</div>
</div>
<div x-data="{
toggleFullscreen() {
this.$refs.test.requestFullscreen();
}
}">
<h1>Testing</h1>

<button @click="toggleFullscreen">Go Fullscreen</button>

<div x-ref="test" class="h-96 w-96 bg-red-400">
- my fullscreen element
</div>
</div>
4 replies
FFilament
Created by Maxime on 10/7/2024 in #❓┊help
Programmatically fill repeaters in EditRecord page
Is there a way to fill repeaters in an EditRecord page with some values ? Using ->default() is only possible on a CreateRecord page IIRC. I've tried directly using
$form->fill([
'repeated_field' => [
['key' => 'value'],
['key' => 'value'],
...
]
]);
$form->fill([
'repeated_field' => [
['key' => 'value'],
['key' => 'value'],
...
]
]);
but nothing gets added to the repeater, and if i dd() the form raw state right after, this is what i get :
array:1 [
"repeated_field" => []
]
array:1 [
"repeated_field" => []
]
13 replies