She has made it abundantly clear that they are not dating. Adult life is messy, and she obviously had strong feelings for this ex-boyfriend. So strong that she is having regular sex with a guy who happened to live in the apartment they used to share. She isn't doing well emotionally and probably hasn't been for a long time. Though I don't particularly like it either, plot-wise it makes sense that this would happen.