diff --git a/CHANGELOG.md b/CHANGELOG.md index 462b3bebe1..6aa2248a71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +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/). +## [6.11.0] - 2025-12-18 + +### Added + +- Added a `TextSelected` event. https://github.com/Textualize/textual/pull/6290 + ## [6.10.0] - 2025-12-16 ### Fixed @@ -3246,6 +3252,8 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040 - New handler system for messages that doesn't require inheritance - Improved traceback handling +[6.11.0]: https://github.com/Textualize/textual/compare/v6.10.0...v6.11.0 +[6.10.0]: https://github.com/Textualize/textual/compare/v6.9.0...v6.10.0 [6.9.0]: https://github.com/Textualize/textual/compare/v6.8.0...v6.9.0 [6.8.0]: https://github.com/Textualize/textual/compare/v6.7.1...v6.8.0 [6.7.1]: https://github.com/Textualize/textual/compare/v6.7.0...v6.7.1 diff --git a/pyproject.toml b/pyproject.toml index 8d9c3be28d..9a0c582945 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "textual" -version = "6.10.0" +version = "6.11.0" homepage = "https://github.com/Textualize/textual" repository = "https://github.com/Textualize/textual" documentation = "https://textual.textualize.io/" diff --git a/src/textual/events.py b/src/textual/events.py index 29271cb1ab..b1d79d8d34 100644 --- a/src/textual/events.py +++ b/src/textual/events.py @@ -976,3 +976,7 @@ class DeliveryFailed(Event, bubble=False): name: str | None = None """Optional name returned to the app to identify the download.""" + + +class TextSelected(Event, bubble=True): + """Sent from the screen when text is selected (Not Input and TextArea)""" diff --git a/src/textual/screen.py b/src/textual/screen.py index 61d38376f0..b21f964d8a 100644 --- a/src/textual/screen.py +++ b/src/textual/screen.py @@ -1698,6 +1698,7 @@ def _forward_event(self, event: events.Event) -> None: self.clear_selection() self._mouse_down_offset = None self._selecting = False + self.post_message(events.TextSelected()) elif isinstance(event, events.MouseDown) and not self.app.mouse_captured: self._box_select = event.shift