From 3745bbe9b8765d066476699b85e49df51a77ca05 Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Sat, 26 Apr 2025 18:08:54 +0100 Subject: [PATCH 1/2] fix(button): prevent text selection --- src/textual/widgets/_button.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/textual/widgets/_button.py b/src/textual/widgets/_button.py index c11ff39fb0..48e71679c2 100644 --- a/src/textual/widgets/_button.py +++ b/src/textual/widgets/_button.py @@ -44,6 +44,8 @@ class Button(Widget, can_focus=True): """ + ALLOW_SELECT = False + DEFAULT_CSS = """ Button { width: auto; From 0692795542581057fc04cbf607f4fd4eb5e5792f Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Sat, 26 Apr 2025 18:22:43 +0100 Subject: [PATCH 2/2] docs(changelog): add fix for button text selection --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 115a20b91c..2d3ee6b430 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased + ### Fixed - Fixed `OptionList` causing excessive redrawing https://github.com/Textualize/textual/pull/5766 +- Fixed `Button` allowing text selection https://github.com/Textualize/textual/pull/5770 ## [3.1.1] - 2025-04-22