- Issue created by @pdureau
- 🇫🇷France pdureau Paris
It is not a UI Patterns 2 issue but a Core SDC issue.
#attributes
property, which is an expected "classic" of render elements is not processed:[ "#type" => "component", "#component" => "ui_suite_uswds:logo", "#attributes" => [ "foo" => "bar", ], "#slots" => [ "content" => "Heloooo", ] ]
That's not good because many Drupal mechanisms are expecting this render property and inject data in it.
That also shows than, one year after the landing of SDC in Drupal Core, only a few people is using it with the Render API.
A dirty fix would be to add this to ComponentElement::preRenderComponent():
if (isset($element["#attributes"])) { $props["attributes"] = new Attribute($element["#attributes"]); }
But we need to :
- consider the merging with existing values in
$props["attributes"]
- check where the default
attribute
object is created (not in ComponentElement, which is surprising)
- consider the merging with existing values in
- Merge request !153Issue #3462818 by pdureau: Support #attributes render property → (Merged) created by pdureau
- Issue was unassigned.
- Status changed to Fixed
5 months ago 7:45am 29 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.