While vacancies have rarely arisen in presidential election years, there has been one presidential election year confirmation in the modern era, that of Justice Anthony Kennedy in February 1988. Justice Lewis Powell retired from the Court in June 1987. President Reagan first nominated Robert Bork to fill the vacancy in July 1987, but Bork was defeated in the Senate in October. President Reagan then nominated Douglas Ginsburg to fill the Powell seat, but then-Judge Ginsburg quickly withdrew after it was revealed that he had smoked marijuana as a law professor at Harvard in the 1970s. It is my understanding Judge Ginsburg’s withdrawal was prompted, in part, by a concern that a confirmation fight could prevent the seat from being filled before the 1988 election. President Reagan then nominated Anthony Kennedy on November 30, 1987. Then-judge Kennedy was less controversial than either Bork or Ginsburg, and was confirmed in February 1988.
The Powell seat was vacant for seven months before the Senate confirmed his successor. This was not the longest vacancy in the modern era, however. When Justice Fortas stepped down in May 1969, it would be a full year (well, 363 days to be precise) before his successor was confirmed. One reason it took so long to fill the Fortas seat is because the Senate rejected President Nixon’s first two nominees for the seat — Clement Haynesworth and Harold Carswell — before confirming Harry Blackman. The Court did its work with only eight justices in the interim. (Also of note, the Court went several months with only seven justices in 1971 after Justices Harlan and Black stepped down that September. Their replacements were confirmed in December.)
For what it’s worth, the last time a justice was nominated to the Court in a presidential election year and confirmed by a Senate controlled by the opposing party was 1888, when President Grover Cleveland nominated Justice Melville Fuller to be Chief Justice. Fuller was nominated April 30 and confirmed on July 20 by a vote of 41-20. President Cleveland was a Democrat, and the Senate had a slim 39-37 Republican majority.