This is a trivial question that is not usually considered in the basic statements on electron-nucleus interaction. We are talking about excited states and ground states of the electrons or about the changes in the probability of presence of the electrons due to the absorption or emission of energy.
In other words, we are talking about a relationship between distances or probabilities of presence and the absorption and emission of energy.
We also know that electrons and protons attract each other through their electric fields because of their different electric charges. Is this the case until the ground state is reached in the atom?