From d101e3d4e72ae1ad7dbc21a1f854fcfa88a3983a Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Tue, 24 Jan 2023 20:16:50 +0000 Subject: [PATCH] Fix double-paste into `Input` See #1657. --- CHANGELOG.md | 1 + src/textual/widgets/_input.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b014c4fbb2..74703fded5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed stuck screen https://github.com/Textualize/textual/issues/1632 - Fixed relative units in `grid-rows` and `grid-columns` being computed with respect to the wrong dimension https://github.com/Textualize/textual/issues/1406 +- Fixed double-paste into `Input` https://github.com/Textualize/textual/issues/1657 ## [0.10.1] - 2023-01-20 diff --git a/src/textual/widgets/_input.py b/src/textual/widgets/_input.py index 497b7c6710..1046c732ee 100644 --- a/src/textual/widgets/_input.py +++ b/src/textual/widgets/_input.py @@ -256,6 +256,7 @@ async def on_key(self, event: events.Key) -> None: def on_paste(self, event: events.Paste) -> None: line = event.text.splitlines()[0] self.insert_text_at_cursor(line) + event.stop() def on_click(self, event: events.Click) -> None: offset = event.get_content_offset(self)