Active
Project:
Custom Elements
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2025 at 13:41 UTC
Updated:
22 Jan 2025 at 13:41 UTC
Jump to comment: Most recent
Two things:
$ce = CustomElement::create('MYTAG')
->setSlot('content', 'FIRST')
->addSlot('content', 'SECOND');
sets slotNormalizationStyle NORMALIZE_AS_SINGLE_VALUE. (Specifically: a setSlot() call without $index parameter does this.)
<mytag><div slot="content">FIRST</div><div slot="content">SECOND</div></mytag>
But normalizing JSON produces
[ 'element' => 'mytag', 'content' => 'FIRST']
In other words, the CustomElement::$slotNormalizationStyles property is only used for JSON output, not HTML.
Work out what we want to do with this.
(CustomElement and set/addSlot() calls' documentation could use an overhaul/extension, apart from this. I'll later decide whether to do this in this same issue, or maybe file a followup, or maybe I will have already done that before this issue is addressed...)
Comments