From a84e37bb8a6a5270a5c39ec4768cbff2e49ec4df Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Thu, 8 Oct 2020 13:54:36 +0000 Subject: [PATCH] [FIX] mail: plain-text messages word-wrap in Discuss UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a user sends a plaintext email to a mail-enabled channel, the rendering of this message in Discuss have present a horizontal scroll when the text contains long sentences. This commit fixes it by enabling wrapping of the line's word to fit its container size and prevent horizontal scrolling. Note: the required CSS rules were already present since odoo/odoo@0e7e18ff71f3b490522358fa689ada7635dcd26a but a wrapper element (with the class `.o_thread_message_content`) was introduced in odoo/odoo@4685e4bc7f19f964697bf0dbd7dfdf254b6c5628 and merged between the testing of the fix above and its actual merging in the Odoo codebase, making it ineffective. We only have to properly re-enable it. opw-2341485 Related task ID: 34931 closes odoo/odoo#59719 X-original-commit: 5e66ca8d2c970eed999782bdd59e9082f3967833 Signed-off-by: Adrien Dieudonné (adr) --- addons/mail/static/src/components/message/message.scss | 5 +++++ addons/mail/static/src/scss/thread.scss | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/components/message/message.scss b/addons/mail/static/src/components/message/message.scss index 0b03a8ba835..8fe3d7a2219 100644 --- a/addons/mail/static/src/components/message/message.scss +++ b/addons/mail/static/src/components/message/message.scss @@ -48,6 +48,11 @@ // the style without this rule. overflow: auto; + > pre { + white-space: pre-wrap; + word-break: break-word; + } + > p:last-of-type { margin-bottom: 0; } diff --git a/addons/mail/static/src/scss/thread.scss b/addons/mail/static/src/scss/thread.scss index 17c0ae72655..070adb6d518 100644 --- a/addons/mail/static/src/scss/thread.scss +++ b/addons/mail/static/src/scss/thread.scss @@ -84,10 +84,9 @@ min-width: 0; max-width: 100%; word-wrap: break-word; - > pre { + .o_thread_message_content > pre { white-space: pre-wrap; word-break: break-word; - text-align: justify; } .o_mail_note_title {