Some states have, but not the US as a whole. You might also be thinking of an agreement that several states have entered where, if those states were to have a combined total of 270 electoral votes, they would hand all EC votes to the winner of the popular vote regardless of who won those states. They're not at 270 yet and will have a hard time getting there, and it would probably not hold up in SCOTUS. It's called the National Popular Vote Interstate Compact, look it up.
Some states have, but not the US as a whole. You might also be thinking of an agreement that several states have entered where, if those states were to have a combined total of 270 electoral votes, they would hand all EC votes to the winner of the popular vote regardless of who won those states. They're not at 270 yet and will have a hard time getting there, and it would probably not hold up in SCOTUS. It's called the National Popular Vote Interstate Compact, look it up.