Open msimecek opened 6 years ago
Can you use the developer tools to inspect the styles that are being applied? I copied your code into a CodePen and it looks to be working fine: https://codepen.io/mikewheaton/pen/mKzzeK
@mikewheaton Your CodePen works fine on my machine too. I don't see any difference in code... I even added jQuery and Fabric jQuery plugin to match your CodePen fully and it still doesn't work... You can see for yourself: https://dxfabrictest.azurewebsites.net/ (not live anymore)
These are the styles applied to A:
.ms-lg2 {
width: 16.666666666666664%;
}
.ms-Grid-col {
position: relative;
min-height: 1px;
padding-left: 8px;
padding-right: 8px;
box-sizing: border-box;
}
.ms-Fabric {
color: #333;
font-family: "Segoe UI Web (West European)",Segoe UI,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;
font-size: 14px;
}
This is B:
.ms-lg10 {
width: 83.33333333333334%;
}
.ms-Grid-col {
position: relative;
min-height: 1px;
padding-left: 8px;
padding-right: 8px;
box-sizing: border-box;
}
.ms-Fabric {
color: #333;
font-family: "Segoe UI Web (West European)",Segoe UI,-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;
font-size: 14px;
}
Sorry for the confusion here, the CodePen I linked to was using an old version of Fabric. Newer versions require the dir
attribute to be set to indicate whether to render in the standard left-to-right (LTR) direction or right-to-left (RTL).
So you'll need to add dir="ltr"
to the html or body tag, or to the Grid div itself as shown here: https://codepen.io/mikewheaton/pen/YvJbBR?editors=1100
Hope that helps!
Yes! This solves it for me, thanks :) Should I create a PR to update the docs?
BTW - both your CodePens use the same Fabric version. The only difference is the dir="ltr"
... I still don't understand why both of them work. CodePen doesn't specify dir
anywhere on the page.
I forked from an old CodePen, which also had Fabric Core 2.1.0 loaded (hidden away in the settings):
And yes, we'd love a PR to update the docs!
Done. See: https://github.com/OfficeDev/office-ui-fabric-react/pull/5430 (had to do it in the React repo, because Core repo doesn't reflect the live site)
I'm using Fabric Core from CDN (v9.6.0) and whatever I try, the columns in
ms-Grid
render below one another, not next to each other. I've copy&pasted the sample from docs and it doesn't work either. Am I doing domething wrong or is it a bug in Fabric?HTML:
And result (with borders for clarity):
Edge
Firefox