.CanvasZoneContainer class no longer available in Publish mode

Copper Contributor

We have a custom webpart code created using spfx react framework. For a specific requirement to set a webpart background, we are using below custom code:

 jQuery('.CanvasZoneContainer:first').css({
      "background-image":"url("+this.props.context.pageContext.web.absoluteUrl+"/SiteAssets/content.jpg)",
      "height":"200px",
      "background-position":"40% 60%",
    }); 
This used to set the background image and was working fine earlier. Now from past few days, this is setting background image of webpart only in edit mode of page but not in publish mode of page.
We have checked '.CanvasZoneContainer' is now present only in sharepoint web page edit mode but no longer available in publish mode , suspecting of page layout change from Microsoft.

0 Replies