“According to the Constitution, the state legislatures choose the presidential electors”
I just looked that up. The electors were chosen in each state by popular vote over a five day period.
Each state shall appoint, in such manner as the legislature thereof may direct, a number of electors equal to the whole number of senators and representatives to which the state may be entitled in the Congress, but no senator or representative or person holding an office of trust or profit under the United States shall be appointed an elector.
The Congress may determine the time and place of choosing the electors and the day on which they shall give their votes, which day shall be the same throughout the United States.
In our first presidential elections, the state legislatures chose the electors. Then the states began to pass that onto the voters via the formula that Maine and Nebraska use today. Then when the two party system, as we know it, came into being, the states switched to a winner-take-all formula.
As late as 1844, South Carolina was still having its state legislature choose electors, and that didn't end until 1868. There is no constitutional requirement for a general election to choose presidential electors. It's simply how the system evolved over time.
The Supreme Court ruled in the 19th Century that final authority over electors still resides with the state legislature. That's why in 2000 the Florida legislature had a slate of Bush/Cheney electors ready to go by the Safe Harbor Date if the courts continued to dither over the subject.