From 9b650c5c8fdba208e335e114fffa838cc93e4d2d Mon Sep 17 00:00:00 2001 From: Neil Kalman Date: Thu, 12 Jan 2017 18:12:52 +0200 Subject: [PATCH] fix scrollbar for RTL languages (#1150) make the behavior same as before for both RTL and LTR languages make solution use dynamic scrollbar size as suggested in CR --- app/js/message_composer.js | 10 +++++++++- app/less/desktop.less | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/js/message_composer.js b/app/js/message_composer.js index 5a9fcb64..eb28cab5 100644 --- a/app/js/message_composer.js +++ b/app/js/message_composer.js @@ -733,7 +733,15 @@ MessageComposer.prototype.setUpInput = function () { if (!Config.Mobile) { var sbWidth = getScrollWidth() if (sbWidth) { - (this.richTextareaEl || this.textareaEl).css({marginRight: -sbWidth}) + // hide scrollbar for both LTR and RTL languages + // both scrollbars are hidden inside the paddings + // that are overflown outside of view + (this.richTextareaEl || this.textareaEl).css({ + left: -sbWidth, + width: 'calc(100% + ' + (2 * sbWidth) + 'px)', + 'padding-left': sbWidth + 2, + 'padding-right': sbWidth + 28 + }) } } } diff --git a/app/less/desktop.less b/app/less/desktop.less index e08b030e..8682b7bc 100644 --- a/app/less/desktop.less +++ b/app/less/desktop.less @@ -1154,11 +1154,13 @@ a.im_panel_peer_photo .peer_initials { box-shadow: none; outline: none; box-shadow: 0 1px 0 0 #e8e8e8; - padding: 1px 30px 1px 0; + padding: 1px 28px 1px 0; + position: relative; margin: 0; min-height: 50px; line-height: 20px; height: auto; + box-sizing: border-box; &:focus { border: 0; @@ -2207,4 +2209,4 @@ a.im_panel_peer_photo .peer_initials { height: 18px; margin: 23px 27px; } -} \ No newline at end of file +}