
[Issue symptoms]:
Working with a modern SharePoint list in gallery view and I'm trying to make the content within each list item scrollable.
Code tried:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
"height": 450,
"width": 250,
"hideSelection": true,
"fillHorizontally": true,
"formatter": {
"elmType": "div",
"attributes": {
"class": "sp-card-container"
},
"style": {
"overflow-y": "auto",
"height": "=if([$Title] == 'No current alerts.', '300px', '450px')",
},
"children": [
.......
]
}
}
Also tried "overflow-y": "scroll"
.
[Solution]:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
"height": 475,
"width": 250,
"hideSelection": true,
"fillHorizontally": true,
"formatter": {
"elmType": "div",
"attributes": {
"class": "sp-card-container"
},
"style": {
"height": "=if([$Title] == 'No current alerts.', '300px', '450px')"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-white sp-css-borderColor-neutralLight sp-card-borderHighlight sp-card-subContainer"
},
"style": {
"overflow-y": "auto",
"max-height": "450px"
},
"children": [...]
}
Thanks for @Cadence Lamphiear sharing his solution here.