From 7ae697797eacd491c67d816784f58e0c22cce4e2 Mon Sep 17 00:00:00 2001 From: Charles Thompson Date: Mon, 9 Feb 2026 11:36:53 -0500 Subject: [PATCH] Fix Select widget border not rendering due to BLANK name collision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Widget.BLANK` (added in 7.1.0, checked in `render_line`/`render_lines` since 7.2.0) collides with `Select.BLANK`, which is a `NoSelection` sentinel object. Because `NoSelection` is truthy, the `if self.BLANK:` check inadvertently matches, causing `Select` to skip normal rendering and return blank strips — losing its border. Use `is True` instead of truthiness to ensure only the boolean `True` triggers blank rendering. Co-Authored-By: Claude Opus 4.6 --- src/textual/widget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/textual/widget.py b/src/textual/widget.py index 68c88b0f39..96144b2df0 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -4206,7 +4206,7 @@ def render_line(self, y: int) -> Strip: Returns: A rendered line. """ - if self.BLANK: + if self.BLANK is True: return Strip.blank(self.size.width, self.visual_style.rich_style) if self._dirty_regions: @@ -4227,7 +4227,7 @@ def render_lines(self, crop: Region) -> list[Strip]: Returns: A list of list of segments. """ - if self.BLANK: + if self.BLANK is True: strips = [ Strip.blank(crop.width, self.visual_style.rich_style) ] * crop.height