filament icon indicating copy to clipboard operation
filament copied to clipboard

TimePicker does not show value after saving form

Open mendizalea opened this issue 3 years ago • 3 comments

Package

filament/filament

Package Version

v.2.15.4

Laravel Version

v.9.22.1

Livewire Version

No response

PHP Version

PHP 8.1.6

Problem description

When a TimePicker is added inside a repeater, the value is not shown once the form is saved. If a refresh is made, it is displayed correctly.

It only fails when an update is done, when create it works fine.

I have tried changing the DatePicker with a TextInput and it works correctly.

Expected behavior

Show the value once the form is saved without having to refresh.

Steps to reproduce

public static function form(Form $form): Form
{
	return $form
		->schema([
		Section::make('General')
		   ->schema([
			  Forms\Components\Grid::make()
				 ->schema([
					TextInput::make('name')
					   ->rule('required'),
				 ])
		   ])->columnSpan([
			  'sm' => 2,
		   ]),
			Section::make('Prueba')
		   ->schema([
			  Forms\Components\Grid::make()
				 ->schema([
					Repeater::make('times')
					   ->relationship()
					   ->schema([
						  TimePicker::make('time')
							 ->withoutSeconds()
							 ->rule('required')
							 ->reactive()
							 ->columnSpan([
								'md' => 3,
							 ]),
					   ])
					   //->createItemButtonLabel('Add New Machinery')
					   ->dehydrated()
					   ->defaultItems(0)
					   ->disableLabel()
					   ->columns([
						  'md' => 9,
					   ])
					   ->columnSpan([
						  'md' => 2,
					   ]),
				 ])
		   ])->columnSpan([
			  'sm' => 2,
		   ]),
		]);
}

Reproduction repository

https://github.com/mendizalea/filament-datapicker-bug

Relevant log output

No response

mendizalea avatar Jul 29 '22 21:07 mendizalea

Hey @mendizalea! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to give us some instructions on where to find the bug, and include a database seeder with everything we need to set it up quickly.

github-actions[bot] avatar Jul 29 '22 21:07 github-actions[bot]

Thank you for providing reproduction steps! Reopening the issue now.

github-actions[bot] avatar Jul 29 '22 22:07 github-actions[bot]

I can reproduce this issue.

However, I'm not yet sure how to fix it. It seems the field's state gets reset on saving the edit form. Any idea, @danharrin? Since you built the date picker originally.

zepfietje avatar Jul 30 '22 20:07 zepfietje

This bug is not present in the latest release of Filament.

danharrin avatar Aug 16 '22 21:08 danharrin