From d55410cc0ded9f4e75294bee4f88a26c07eef16d Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Mon, 25 Mar 2024 16:45:58 +0000 Subject: [PATCH] Text area flicker fix (#4334) --- CHANGELOG.md | 1 + src/textual/widgets/_text_area.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a0cb30a51..49d8b9e2e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed a crash in `TextArea` when undoing an edit to a selection the selection was made backwards https://github.com/Textualize/textual/issues/4301 - Fixed issue with flickering scrollbars https://github.com/Textualize/textual/pull/4315 +- Fixed issue where narrow TextArea would repeatedly wrap due to scrollbar appearing/disappearing https://github.com/Textualize/textual/pull/4334 - Fix progress bar ETA not updating when setting `total` reactive https://github.com/Textualize/textual/pull/4316 ### Changed diff --git a/src/textual/widgets/_text_area.py b/src/textual/widgets/_text_area.py index 501eef8f40..71e1b3fd7c 100644 --- a/src/textual/widgets/_text_area.py +++ b/src/textual/widgets/_text_area.py @@ -688,7 +688,8 @@ def _watch_indent_width(self) -> None: self.scroll_cursor_visible() def _watch_show_vertical_scrollbar(self) -> None: - self._rewrap_and_refresh_virtual_size() + if self.wrap_width: + self._rewrap_and_refresh_virtual_size() self.scroll_cursor_visible() def _watch_theme(self, theme: str) -> None: