Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ibnmajah:476ʿAbdullāh b. ʿĀmir b. Zurārah > Ibn Abū Zāʾidah > Ḥurayth b. Abū Maṭar > Yaḥyá b. ʿAbbād Abū Hubayrah al-Anṣārī > Saʿīd b. Jubayr > Ibn ʿAbbās

"He would sleep like that while he was sitting up."  

ابن ماجة:٤٧٦حَدَّثَنَا عَبْدُ اللَّهِ بْنُ عَامِرِ بْنِ زُرَارَةَ عَنِ ابْنِ أَبِي زَائِدَةَ عَنْ حُرَيْثِ بْنِ أَبِي مَطَرٍ عَنْ يَحْيَى بْنِ عَبَّادٍ أَبِي هُبَيْرَةَ الأَنْصَارِيِّ عَنْ سَعِيدِ بْنِ جُبَيْرٍ عَنِ ابْنِ عَبَّاسٍ قَالَ

كَانَ نَوْمُهُ ذَلِكَ وَهُوَ جَالِسٌ يَعْنِي النَّبِيَّ ﷺ