pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.76k stars 844 forks source link

View Honeycomb-link: zero height when embedded as list webpart #522

Closed Fungopus closed 1 year ago

Fungopus commented 2 years ago

I tested the honeycomb-link view as an embedded webpart on a SharePoint Online site (modern experience).

What should happen

When setting the size in the List webpart to automatic, the height of the webpart should be exactly the same as all displayed items in the list.

What actually happens

The List with it's items is displayed as if every item has a height of 0 or maybe 1 pixel and two scrollbar arrows appear (red box). image To solve this atm I need to choose a webpart size (5, 15 or 30 elements) which fits my needs. This produces additional white-space below the list.

MeggosDeGinger commented 1 year ago

Has anyone found a solution for the autosize not working?

Bella-Puella88 commented 1 year ago

Changing the size of the octagons will make it fit in the small view setting:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "hideSelection": true, "hideColumnHeader": true, "rowFormatter": { "elmType": "div", "style": { "position": "absolute", "width": "100px", "height": "100px", "left": "=if(floor(@rowIndex/5) % 2 == 0 , @rowIndex % 5 100 + 'px' , @rowIndex % 5 100 + 50 + 'px' )", "top": "=floor(@rowIndex / 5) * 85 + 'px'" }, "children": [ { "elmType": "a", "style": { "position": "relative", "display": "flex", "justify-content": "center", "align-items": "center", "width": "100%", "height": "100%" }, "attributes": { "href": "[$URL]", "target": "_blank", "class": "ms-fontColor-themePrimary ms-fontColor-themeDark--hover" }, "children": [ { "elmType": "svg", "style": { "fill": "currentColor", "cursor": "pointer" }, "attributes": { "viewBox": "-100 -100 200 200" }, "children": [ { "elmType": "path", "attributes": { "d": "M90 50 L0 100 L-90 50 L-90 -50 L-0 -100 L90 -50 z" } } ] }, { "elmType": "div", "style": { "position": "absolute", "display": "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center", "cursor": "pointer", "width": "100%", "height": "100%" }, "attributes": { "class": "ms-fontColor-white" }, "children": [ { "elmType": "div", "style": { "font-size": "32px", "margin-bottom": "5px" }, "attributes": { "iconName": "[$Icon]" } }, { "elmType": "div", "style": { "font-size": "14px", "width": "75%", "text-align": "center" }, "txtContent": "[$Title]" } ] } ] } ] } }

tecchan1107 commented 1 year ago

Fixed so that links are displayed even when displayed in web parts https://github.com/pnp/List-Formatting/pull/658 https://github.com/pnp/List-Formatting/tree/master/view-samples/honeycomb-link