The sun was eclipsed, so the Messenger of Allah ﷺ prayed.In the narration it states, they said, "Messenger of Allah, we saw you reach out for something while standing in your place, then we saw you draw back."He replied, "I was shown Paradise, and I reached out for a cluster of its grapes. Had I taken it, you would have eaten from it for as long as the world remains." The hadith continues.
خسفت الشمس، فصلى رسول الله ﷺ… وفيه: قالوا: يا رسول الله، رأيناك تناول شيئا في مقامك، ثم رأيناك تكعكعت قال: إني أريت الجنة، فتناولت منها عنقودا، ولو أخذته لأكلتم منه ما بقيت الدنيا الحديث.
Malik narrated it in the chapter on the prayer for eclipse (445) from Zayd bin Aslam, from Ata bin Yasar, from Abdullah bin Abbas, and mentioned it in a long hadith. Bukhari narrated it in the chapter on the eclipse (1052) through the route of Malik, with the same wording. Muslim narrated it in the chapter on the eclipse (907) through another route from Zayd bin Aslam, with the same wording.