Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Renderer/TangibleFieldsRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ protected function extract_fields_from_item( array $item ): array {
$fields[] = [
'type' => 'accordion',
'label' => $item['label'],
'title' => $item['label'],
'value' => true, // Expanded by default.
'fields' => $section_fields,
];
Expand Down Expand Up @@ -224,7 +225,7 @@ protected function render_tabs( array $tabs_structure ): string {
}

$tabs[ $tab_key ] = [
'label' => $tab['label'],
'title' => $tab['label'],
'fields' => $tab_fields,
];
}
Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/data-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,8 @@ public function test_renderer_extract_fields_preserves_section_structure(): void
// Should return an accordion config that preserves the section label.
$this->assertCount( 1, $result );
$this->assertEquals( 'accordion', $result[0]['type'] );
$this->assertArrayHasKey( 'title', $result[0] ); // Required by Fields library.
$this->assertEquals( 'Contact Info', $result[0]['title'] );
$this->assertEquals( 'Contact Info', $result[0]['label'] );
$this->assertTrue( $result[0]['value'] ); // Expanded by default.
$this->assertArrayHasKey( 'fields', $result[0] );
Expand Down