This question is discussed on p. 24 of Paul J. Nahin's Time Machines: Time Travel in Physics, Metaphysics, and Science Fiction (2nd edition, ISBN 0-387-98571-9):
Of course, one might argue that Wells' machine does actually move, because it is attached to the Earth, which is certainly moving, but it is not clear why this should result in the time machine arriving in the temporal past of the Earth, rather than in some past region of space (almost surely a vacuum.) The general problem of where things are for time travelers has been nicely illustrated by the physicist Gregory Benford in his novel Timescape. In that story the world of 1998 is on the verge of total ecological collapse, and an attempt is made to change the past by aiming a backward-in-time message via faster-than-light tachyons (see Tech Note 7) at the pivotal year 1963. When the principal scientist involved in this effort is explaining the process to a potential financial backer, he is asked, "Hold on. Aim for what? Where is 1963?" The scientist replies, "Quite far away, as it works out. Since 1963, the Earth's been going round the Sun, while the sun itself is revolving around the hub of the galaxy, and so on. Add that up and you find 1963 is pretty distant."
So there is one stfnal work that acknowledges the spatial-displacement aspect of time travel: the novel Timescape
by Gregory Benford.
The other one Dr. Nahin mentions is an old short story, "Dead End" by Malcolm Jameson, in Thrilling Wonder Stories, March 1941 (available at the Internet Archive, click here for download options):
An understanding of the question "Where is everything?" actually goes quite a bit further back in fiction. For example, after looking through a TV-like gadget to view the past, one character in the 1941 story "Dead End" (Jameson) complains, "You said you'd find Captain Kidd's treasure, but all I can see is fog and static." He is told that's because "It's too far back—1698 or thereabouts. The Earth was billions of miles from here then, and there are too many cosmic rays between." The "cosmic rays" are presumably the cause of the interference.
P.S. Here's a better example, or at least an earlier one: "The Derelict of Space" (1931) by William T. Thurmond and Ray Cummings, originally published in Wonder Stories Quarterly, Fall 1931, available at the Internet Archive (click here for download options). I quote portions of Everett F. Bleiler's review in Science-Fiction: The Gernsback Years:
The exploratory spaceship sights a strange copper disk-like vessel in space. It is obviously derelict, and an elderly member of the crew recognizes it as the Deely time machine that left Earth around forty years earlier. The space men board the vessel, find six corpses and a manuscript kept by one of the time travelers. [. . .] The gimmick is that while the time machine moved in time, it was stationary in space; the universe moved away from it, leaving it isolated.
This story was actually written by Cummings based on a plot submitted as a contest entry by Thurmond. The time-travel "science" was criticized in a letter "Would Find the Earth Under Them" by reader Jack Cypin in Wonder Stories Quarterly, Winter 1932 (available at the Internet Archive, click here for download options), which was rebutted in a letter by Thurmond in Wonder Stories Quarterly, Spring 1932 (available at the Internet Archive, click here for download options).
P.P.S. This aspect of time travel is touched on in R. A. Lafferty's 1981 novelette "Bank and Shoal of Time":
"All ghost appearances are time trips. But time is sticky stuff, and it is always local," Rowena lectured them. "We are in a galactic drift of several billion miles a year, so there is no way we could return to any spot on earth in any past time according to absolute location in space. The spot on earth now would be billions of miles away from the same spot on earth then. But time clings to local physical objects, like a world, and all physical objects are deeply imbedded in time. Time is very cohesive and it can only be moved in quantum hunks, and we can only move out of the common time stream by quantum pushes. So a ghost has to bring part of his ambient with him when he comes, and his minimal ambient is his own clothes. This makes a difficulty for those who believe that travel in time consists of reconstructing people and things, molecule by molecule, in the visited time. How much more difficult the clothes would make it! And yet ghostly time visitants are almost always clothed.