I'm not sure you know what "drop of a hat" means. The split/growth in the Democratic party on race issues was a process that developed over 100+ years.
I'm not an expert on every era, but literally just off the top of my head....
* Even before the Civil War, northern Democrats and southern Democrats were split on the slavery issue, to the point that they even nominated different presidential candidates in 1860 (the four-way race was one reason Lincoln was able to win with just 37% of the vote).
* After the Civil War, southern Democrats remained heavily anti-black to a disgusting and violent degree, but northern dems were all over the map. Republicans continued to be radically pro-black (at least compared to the status quo) until the compromise of 1877.
* In the late 1800s and early 1900s, both parties failed Black people to an enormous degree, but ambiguity built. Democrats began moderating their racial viewpoints to the point that W.E.B. supported Woodrow Wilson for president in 1912 and he was elected with significant Black support. However, Wilson turned out to be a flaming racist and was a terrible president for Black people, something DuBois realized very early in his presidency and tore him apart on. That betrayal pretty much helped solidify DuBois's pessimism and depression on political movement for most of the rest of his life.
* FDR was the first Democrat president to actually follow through and gained enormous Black support, to the point where a large majority of Black voters were voting Democrat by the mid-1930s. The New Deal played a big part in that. FDR had lots of shortcomings in race issues (including failing to keep southern democrats from tailoring the New Deal to fukk over Black applicants, and allowing federal policies that continued to advance segregation), but he was also the president who first passed the executive order banning discrimination by race in federal hiring.
* Truman, as I already mentioned, took it further and desegregated the military, prompting the massive exodus of Dixiecrats from the Democratic party (temporary in some cases, permanent in others).
* Of course, you already know the Civil Rights story, where JFK started supporting but with contradictions, then LBJ followed through with a massive effort despite his own personal casual racism.
* The segregationist exodus from the Democratic party hit even harder in 1968, but even then, many southern white racists continued to support Democrat candidates at the state level in an uneasy alliance with black voters, choosing economics (especially union support and wages) over their racism. The full lose of the south to the Republicans didn't really hit until the 2000s.
That's a 150-year process. None of it was at the "drop of a hat". Low-information voters talk like Black voters suddenly started supporting Democrats in the 1960s when the Democrats had already had the Black vote for
thirty years at that point, and Black party identification for nearly 20 years.