Must a component pouch/focus be “out” to be handled, or can I keep it in my pocket?

Ellen the Eldritch Knight is holding a longsword and wants to cast fireball. If she pulls out her component pouch to cast the spell, then (according to this question), she won’t have time during the rest of the action to put it away, so if she gets to make an opportunity attack before her next turn, she won’t be able to use her weapon’s versatile feature. Could this tragedy be avoided by keeping the component pouch in her pocket the whole time and only interacting with it by sticking her hand in her pocket, rather than taking the pouch out of her pocket?