When a plant gets leggy, it means that the vines keep growing but produce less leaves as they grow. Another word for it is spindly. One way to stop it from doing that is to prune it as I mentioned above. Another way is to stake it so it grows up. One of the reasons plants get leggy is that the trailing vines don’t get as much light as one that is staked and growing up. It’s just a matter of preference. One is not better than the other but if you want a plant with the vines trailing down, this can be a risk. Another way to make them less leggy is to put them in a spot that gets more light. Just be sure not to move the plant from low light to high light because it will shock it and burn the leaves. You want it to be brighter but not direct and if it is a lot brighter move the plant for a few hours at a time until it has acclimatized to the new spot with more light. This is the same approach as hardening a plant off to plant it outdoors.