Pretty much if you are holding A while you hit forward on the c stick to smash you will keep the turnip in hand. It doesn't matter how you got to holding A. Air dodges, floats, side steps, rolls, etc all work.
Personaly I just press down B + A at the same time, no extra action necessary.
Personaly I just press down B + A at the same time, no extra action necessary.