title: Sharepoint list custom JSON view not showing correctly in list web-part
body: <p>I have a custom JSON list view that is displayed correctly as a list, but is not keeping its formatting in list web-part. It was ok a couple of weeks ago when I created it but something changed (maybe a Sharepoint update?)</p>
  
  <p><a href="https://i.stack.imgur.com/vdVEw.png" rel="nofollow noreferrer">This is how it looks as list</a></p>
  
  <p><a href="https://i.stack.imgur.com/Ay7Li.png" rel="nofollow noreferrer">And this is how it looks in web-part</a></p>
  
  <p>I would like to make it more compact in web-part and without header.</p>
  
  <p>Here is my JSON code, which worked correctly a couple of weeks ago. Now it seems that hideColumnHeader and height tags are ignored in web-part</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
    "hideSelection": true,
    "hideColumnHeader": true,
    "rowFormatter": {
      "elmType": "a",
      "txtContent": "@currentField",
      "attributes": {
        "class": "sp-field-fontSize14  ms-fontColor-neutralPrimary ms-fontColor-red--hover",
        "href": "[$Link]"
      },
      "style": {
        "text-decoration": "none",
        "width": "300px",
        "min-width": "200px",
        "min-height": "1em",
        "height": "1em",
        "white-space": "nowrap",
        "padding-left": "=if(indexOf(@currentField, ' ') == 1, '', if(indexOf(@currentField, ' ') == 3, '20px', '40px'))"
      }
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am using SharePoint Online, modern experience. Any help in fixing this is greatly appreciated!</p>