During the first three weeks of flowering the plants go through this transition: first a high powered oscillating fan that when on you think might destroy your plants if you're not careful
The fan forces them to use nitrogen to grow short, thick, and strong in the wind instead of tall and lanky.
Second is day and night temps I keep only ONE degree different. Equal temps causes lots of problems for flowering plants and they can begin to yellow due to stored chlorophyll, I believe.
But close enough temps inhibits the burning of nitrogen during the night causing the plant to not grow tall.
Another thing I do is stop giving nitrogen two weeks before flower because nitrogen is what the plants burn to stretch.
They are pretty much thinking "holy crap it's flowering, and I'm not even big yet, better hurry up!"
I do that for three weeks to all new flowering up and comers. You will see the fan works well.
Those would be the best ways to prevent it then after I do keep different day night temps. Ten degrees F lower at night.