From e86d723c3f779a4678116d7fd2fa190d1db985ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Wed, 22 Aug 2018 15:51:07 +0200 Subject: [PATCH] [FIX] web: prevent textarea scrollbar on Firefox The following line is necessary to prevent the scrollbar to appear on the textarea on Firefox when adding a new line if the current line has just enough characters to completely fill the line. This fix should be fine since we compute the height depending on the content, there should never be an overflow. TODO ideally understand why and fix this another way if possible. Task: none PR: none --- addons/web/static/src/js/core/dom.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js index 060bb141eff..115cc5fcf0c 100644 --- a/addons/web/static/src/js/core/dom.js +++ b/addons/web/static/src/js/core/dom.js @@ -115,6 +115,14 @@ return { }).css(direction, -10000); $fixedTextarea.data("auto_resize", true); + // The following line is necessary to prevent the scrollbar to appear + // on the textarea on Firefox when adding a new line if the current line + // has just enough characters to completely fill the line. + // This fix should be fine since we compute the height depending on the + // content, there should never be an overflow. + // TODO ideally understand why and fix this another way if possible. + $textarea.css({'overflow-y': 'hidden'}); + resize(); removeVerticalResize(); $textarea.data("auto_resize", true);