Correct. I went through this with a family member who was struck by a car and later declared brain-dead in hospital—but his heart was still beating, and thus a candidate for heart donation. We said our final goodbyes before he was wheeled away for surgery, heart still beating and looking as alive as ever. The anonymous recipient underwent surgery simultaneously in the same hospital, so presumably the heart only stopped beating for a very short period of time before it was re-started, and it continues on beating to this day (it's a funny feeling, knowing that).
"Donation after cardiac death", as you might imagine, seems a bit weird when the heart is the organ being donated. And so it's a recent invention for the heart (though it has been around for a long time for other organs such as the kidney[1]). There is a free access article from 2018 about the necessity and ethical considerations of cardiac donation after cardiac death in Circ: Heart Failure [2].
1 = https://health.ucdavis.edu/transplant/nonlivingdonors/donati...
2 = https://www.ahajournals.org/doi/10.1161/CIRCHEARTFAILURE.118...