cambridgeweblab / common-ui

A collection of common web components
MIT License
2 stars 2 forks source link

ca-object-list does not create ca-summary elements properly #106

Closed tapina closed 6 years ago

tapina commented 6 years ago

ca-object-list uses create-element rather than create-element-legacy. This (better) version does not treat attribute names as property names.

Unfortunately, ca-summary has one property which is not reflected onto an attribute, and also has a 'type' property which is not reflected onto an attribute of the same name. So the same code used to create a ca-summary in ca-property:

const card = createElement(null, 'ca-summary', { type: 'card', itemsPerCol: 100 });

does not work in ca-object-list because it sets attributes 'type' and 'itemsPerCol' which are ignored by the ca-summary code (which expects 'data-type' and a non-reflected property).

We need to change ca-object-list to set the itemsPerCol property directly (and presumably, the type too).