Unexpected Dehydration of Hidden Fields with statePath
Why are fields that are
Example:
=> log:
without state Path:
log:
hiddenhidden and located inside a SectionSection with a statePathstatePath dehydrated, and how can this be avoided (while still using statePathstatePath)? Normally, hidden inputs should be hidden. Or not?Example:
protected function handleRecordCreation(array $data): Model
{
Log::info(json_encode($data, JSON_PRETTY_PRINT));
dd($data);
}
public function form(Form $form): Form
{
return $form->schema([
Section::make("Your Information")->schema([
TextInput::make('name')->label("Your Name (for section)")->default('test')->hidden(),
])
->columns(2)
->statePath('data'),
]);
}protected function handleRecordCreation(array $data): Model
{
Log::info(json_encode($data, JSON_PRETTY_PRINT));
dd($data);
}
public function form(Form $form): Form
{
return $form->schema([
Section::make("Your Information")->schema([
TextInput::make('name')->label("Your Name (for section)")->default('test')->hidden(),
])
->columns(2)
->statePath('data'),
]);
}=> log:
array:1 [▼
"data" => array:1 [
"name" => "test"
] // (not correct)
]array:1 [▼
"data" => array:1 [
"name" => "test"
] // (not correct)
]without state Path:
protected function handleRecordCreation(array $data): Model
{
Log::info(json_encode($data, JSON_PRETTY_PRINT));
dd($data);
}
public function form(Form $form): Form
{
return $form->schema([
Section::make("Your Information")->schema([
TextInput::make('name')->label("Your Name (for section)")->default('test')->hidden(),
])
->columns(2),
//->statePath('data'), statePath removed
]);
}protected function handleRecordCreation(array $data): Model
{
Log::info(json_encode($data, JSON_PRETTY_PRINT));
dd($data);
}
public function form(Form $form): Form
{
return $form->schema([
Section::make("Your Information")->schema([
TextInput::make('name')->label("Your Name (for section)")->default('test')->hidden(),
])
->columns(2),
//->statePath('data'), statePath removed
]);
}log:
[] // (correct)[] // (correct)