SPFx webparts issue when bootstrap is included

%3CLINGO-SUB%20id%3D%22lingo-sub-2035389%22%20slang%3D%22en-US%22%3ESPFx%20webparts%20issue%20when%20bootstrap%20is%20included%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2035389%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Team%2C%3C%2FP%3E%3CP%3EWe%20are%20having%20a%20issue%20with%20web%20parts%20that%20were%20developed%20with%20ReactJS%2Fno%20javascript%20framework%20with%20Bootstrap%204%20in%20our%20SharePoint%20online%20sites%20due%20to%20the%20out%20of%20the%20box%20elements%20using%20class%20row%20(which%20will%20have%20display%3Aflex%20for%20class%20row%20in%20bootstrap%204).%20These%20web%20parts%20were%20working%20fine%20up%20to%20last%20month.%20After%20updates%20to%20the%20modern%20pages%20from%20microsoft%2C%20we%20are%20facing%20this%20issue%20now(Refer%20the%20image%20which%20has%20tiles%20that%20looks%20shrinked)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-html%22%3E%3CCODE%3E%3CDIV%20class%3D%22a_f_50a7110f%20a_f_50a7110f%20root-81%20CanvasZone%20row%20CanvasZone--alignment%20CanvasZone--noMargin%20CanvasZone--read%22%20data-automation-id%3D%22CanvasZone%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F244492iE4A9115184A1D837%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%26nbsp%3BWhen%20we%20override%20some%20of%20the%20out%20of%20the%20box%20classes%20through%20script%20editor%2C%20it%20works%20and%20looks%20fine%20as%20below%20%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20726px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F244494i7B40909B20D0CAEC%2Fimage-dimensions%2F726x225%3Fv%3D1.0%22%20width%3D%22726%22%20height%3D%22225%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIt's%20also%20affecting%20out%20of%20the%20box%20web%20parts%20in%20the%20same%20page.%20Can%20someone%20please%20provide%20an%20solution%2Fupdate%20on%20it%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ELoksayi%3C%2FP%3E%3C%2FDIV%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2035389%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eare%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2047539%22%20slang%3D%22en-US%22%3ERe%3A%20SPFx%20webparts%20issue%20when%20bootstrap%20is%20included%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2047539%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20team%2C%3CBR%20%2F%3EAny%20one%20able%20to%20replicate%20this%20issue%20from%20your%20end%20%3F%20Any%20solution%20from%20Microsoft%20or%20Should%20we%20change%20override%20bootstrap%20framework%20in%20all%20our%20web%20parts%20%3F%20Kindly%20provide%20an%20update.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi Team,

We are having a issue with web parts that were developed with ReactJS/no javascript framework with Bootstrap 4 in our SharePoint online sites due to the out of the box elements using class row (which will have display:flex for class row in bootstrap 4). These web parts were working fine up to last month. After updates to the modern pages from microsoft, we are facing this issue now(Refer the image which has tiles that looks shrinked)

 

 

<div class="a_f_50a7110f a_f_50a7110f root-81 CanvasZone row CanvasZone--alignment CanvasZone--noMargin CanvasZone--read"
    data-automation-id="CanvasZone">

 

 

image.png
 When we override some of the out of the box classes through script editor, it works and looks fine as below :

image.png

It's also affecting out of the box web parts in the same page. Can someone please provide an solution/update on it ?

 

Regards,

Loksayi

2 Replies

Hello team,
Any one able to replicate this issue from your end ? Any solution from Microsoft or Should we change override bootstrap framework in all our web parts ? Kindly provide an update.

@loksayi I have solved the issue by inserting the following Css in my SPFX webpart:

File: style.css

File content

div > div.CanvasZone--fullWidth > div {
  width100%;
}
 
Import the css file
 
I have also tried to inject custom script via a dedicated webpart but it does not work. Css must be injected by your SPFX webpart