From 8932c1b84c0646cbb45f6c0602e64edbaa10c4aa Mon Sep 17 00:00:00 2001 From: ManhNTX Date: Thu, 14 Jul 2022 00:14:57 +0700 Subject: [PATCH] Weird scroll bar in email view#583 --- .../utils/html_transformer/html_template.dart | 11 ++++++++++- .../views/html_viewer/html_content_viewer_widget.dart | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/lib/presentation/utils/html_transformer/html_template.dart b/core/lib/presentation/utils/html_transformer/html_template.dart index c26a24326..d0b96dc0b 100644 --- a/core/lib/presentation/utils/html_transformer/html_template.dart +++ b/core/lib/presentation/utils/html_transformer/html_template.dart @@ -42,8 +42,17 @@ String generateHtml(String content, { resize: ${resize ?? 'both'}; min-height: ${minHeight ?? 0}px; min-width: ${minWidth ?? 0}px; - overflow: ${hideScrollBar == true ? 'hidden' : 'auto'}; + overflow: auto; } + ${hideScrollBar == true ? ''' + .tmail-content::-webkit-scrollbar { + display: none; + } + .tmail-content { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + } + ''' : ''} ${styleCSS ?? ''} ${javaScripts ?? ''} diff --git a/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart b/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart index 0e064e852..5912dfcd9 100644 --- a/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart +++ b/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart @@ -55,7 +55,7 @@ class _HtmlContentViewState extends State { } String _generateHtmlDocument(String content) { - final htmlTemplate = generateHtml(content, hideScrollBar: false); + final htmlTemplate = generateHtml(content); return htmlTemplate; }