As the Hebrew Masoretic text stands, at the conclusion of Hannah's prayer, Elkanah returns to Ramah (= Ramathaim, as in 1 Sam 1:1).
In terms of "action", however, 1 Sam 2:11 is the next bit of unfolding narrative subsequent to the conclusion of chapter 1 -- the song/prayer intervening.
In the Greek (Septuagint) text, however, things work out differently after Hannah's Song - it continues this way:
2:11 καὶ κατέλιπον* αὐτὸν ἐκεῖ ἐνώπιον κυρίου καὶ ἀπῆλθον* εἰς Αρμαθαιμ...
kai katelipon* auton ekei enōpion kuriou kai apēlthon* eis Armataim...
and they left him there before the Lord and departed to Armathaim...
* The text above is the LXX as it appears in Rahlfs. It should be further noted that the "B" text (Vaticanus) reads -en for these verbs, not -on, i.e., "she left him ... and she returned...".
Even the 1985 Jewish Publication Society Tanakh makes an adjustment in its translation of the Hebrew text at this point: "Then Elkanah [and Hannah] went home to Ramah...". And the Greek version likewise is preferred by commentators, both older (e.g. S.R. Driver, pp. 22-23) and newer (e.g. P.K. McCarter, p. 78).
As the subsequent narrative makes clear, however, Hannah has returned home, even in the Hebrew tradition (see 1 Sam 2:18-21). The fact her name is omitted in the Hebrew text of 1 Sam 2:11 does not, then, require her presence in Shiloh.
This problem has been treated by: J. Cook, “Hannah and/
or Elkanah on their Way Home (1 Samuel 2,11)? A Witness to the Complexity of
the Tradition History of the Samuel Texts,” OTE 3 (1990): 247-262 [no online source I can find]. See also the comments of Donald W. Parry, "Hannah in the Presence of the Lord", in Archaeology of the Books of Samuel: The Entangling of the Textual and Literary History, ed. by P. Hugo and A. Schenker (Brill, 2010), pp. 53-74 (see p. 69). 4QSama "is not attested at this point".