We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bd2c3e commit 78cba96Copy full SHA for 78cba96
src/lib/Twig/Components/OverflowList.php
@@ -54,11 +54,19 @@ public function validate(array $props): array
54
#[ExposeInTemplate('item_template_props')]
55
public function getItemTemplateProps(): array
56
{
57
+ $itemPropsNames = array_keys($this->items[0]);
58
+
59
$itemPropsPatterns = array_map(
- fn (string $name): string => '{{ ' . $name . ' }}',
60
+ static fn (string $name): string => '{{ ' . $name . ' }}',
61
$this->itemTemplateProps
62
);
63
- return array_combine($this->itemTemplateProps, $itemPropsPatterns);
64
+ $props = array_combine($itemPropsNames, $itemPropsPatterns);
65
66
+ if (empty($props)) {
67
+ return [];
68
+ }
69
70
+ return $props;
71
}
72
0 commit comments