0

I'am using the Primeflex Flexgrid according to the documentation, but it wraps to a new line after 11 rows, when instead it should only wrap if 12 rows are used. Does someone have a fix for that? Version in package.json: "primeflex": "^1.0.0-rc.1",

I have included the "node_modules/primeflex/primeflex.css" in my angular.json, otherwise it wouldn't wrap anything at all, so this is not the issue. I suspect the problem is somewhere in the Library, but I am too newbie to find the solution (yet) and simply override it with a SCSS Class myself. I also found an existing issue on Primflexes Github, but the solution that another user reported there is not explained well enough for me to understand it.

See my Stackblitz demo of the problem.

I expect it to work like this (sorry for the picture link, but apparently I'm not smart enough to properly include an image).

Also, if someone with more Rep could add the Tag "Primflex" it would be great.

TheRealOha
  • 43
  • 8

2 Answers2

2

Since maybe not everyone knows what to do with the answer I marked as accepted, I added the description of how I achieved the fix based on the proposal of @piyush jain. This is how I did it:

  1. I created a new SCSS file "_flexgridfix.scss"
  2. I put the file in my src folder on the same level where the "styles.scss" is
  3. Then I added piyush jains code to the file (only the scss class names and the value "box-sizing: border-box;", not the other values, they are not needed)
  4. I then imported the new scss file in the "styles.scss" like this: @import "flexgridfix.scss";

Note: I had to explicitly name the new file with an underscore "_" in the beginning, otherwise Visual Studio Code wouldn't resolve the import properly. Works like a charm, it now wraps correctly.

EDIT: Apparently it's fixed now: see https://github.com/primefaces/primeflex/issues/8#issuecomment-539873278

TheRealOha
  • 43
  • 8
1

do this change and it will fix your issue. Just add box-sizing: border-box;

enter image description here

Piyush Jain
  • 1,895
  • 3
  • 19
  • 40
  • Thank you, that pointed me in the right direction. I had to tinker a little though because your answer gave me the "what", but not the the "how", so I will add my steps as an additional answer, but keep yours as accepted. – TheRealOha Aug 08 '19 at 09:42
  • let me know if you face any issues. – Piyush Jain Aug 08 '19 at 09:50