And Democrats wanted Obama to appoint before the next election and during the Trump administration the Democrats wanted to wait until after the election, both parties are the same.Actually your second example is how both sides DON'T do the same thing.
The republicans saying the winner of the next election should decide who is selected to fill a Supreme Court vacancy. But four years later, republicans completely reverse themselves.