Forum Discussion

lotz-hellerau's avatar
lotz-hellerau
Brass Contributor
Apr 16, 2019

no correct min-width calculation for view-formatting on SharePoint list, when "hideSelection": false

Hi :)

I'm using the view-formatting on a SharePoint list.
I want to set the "hideSelection" to false, because I like to have the right- and double-click functionalities on working with list items.

Here is a excerpt of the code:

{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": false,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"attributes": {
"class": "ms-borderColor-neutralLight"
},
"style": {
"display": "flex",
"position": "relative",
"flex-wrap": "wrap",
"width": "",
"align-items": "stretch",
"flex-direction": "column",
"box-sizing": "border-box",
"border-width": "0px",
"border-left-width": "4px",
"border-style": "solid",
"border-left-color": "#107C10",
"padding-bottom": "20px"
},
"children": [
{
"elmType": "div",
"style": {
"display": "block",
"flex-wrap": "wrap",
"align-items": "stretch",
"box-sizing": "border-box",
"padding": "5px 0 0 20px"
},
"children": [
{

.......

 

Everything is working correctly, but, when I set the "hideSelection" to false, the min-width on the items are not calculated correctly as it does, when I set "hideSelection" to true.

When I open the side on mobile, the min-width calculation is also set correctly.

Here some ScreenShots:

 

Desktop: (min-width is not working -> 0px)

 

 

On Mobile the min-width is set correctly:

 

Is that a bug or can I solve this problem, by changing the code?

Thanks a lot
Kind Regards
Michael

 

    • bird_00's avatar
      bird_00
      Copper Contributor

      lotz-hellerau 

      I'm running into the same issue with hideSelection": true.

       

      Would love to hear if others have solved the issue with row width.

      • lotz-hellerau's avatar
        lotz-hellerau
        Brass Contributor

        bird_00 
        Hi, no there is nothing new about it.
        For now I solved this by making a view for larger screens and one for mobile:
        "width": "=if(@window.innerWidth > '999', '1000px', '')"

         

        So on screens with more then 999px I have a fixed width and on smaller screens, like on mobile devices, the width is correct on 100%.

        I really hope, microsoft will fixe this, because this solution isn't really satisfying.

Resources