Skip to content

Commit

Permalink
add mouse down handler (#3778)
Browse files Browse the repository at this point in the history
* add mouse down handler

* changelog

* version bump
  • Loading branch information
willmcgugan authored Nov 29, 2023
1 parent 60766a3 commit 0ec41af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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/).

## [0.43.1] - 2023-11-29

### Fixed

- Fixed clicking on scrollbar moves TextArea cursor https://github.com/Textualize/textual/issues/3763

## [0.43.0] - 2023-11-28

Expand Down Expand Up @@ -1460,6 +1465,7 @@ 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

[0.43.1]: https://github.com/Textualize/textual/compare/v0.43.0...v0.43.1
[0.43.0]: https://github.com/Textualize/textual/compare/v0.42.0...v0.43.0
[0.42.0]: https://github.com/Textualize/textual/compare/v0.41.0...v0.42.0
[0.41.0]: https://github.com/Textualize/textual/compare/v0.40.0...v0.41.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.43.0"
version = "0.43.1"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
4 changes: 4 additions & 0 deletions src/textual/scrollbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ def action_grab(self) -> None:
"""Begin capturing the mouse cursor."""
self.capture_mouse()

async def _on_mouse_down(self, event: events.MouseDown) -> None:
# We don't want mouse events on the scrollbar bubbling
event.stop()

async def _on_mouse_up(self, event: events.MouseUp) -> None:
if self.grabbed:
self.release_mouse()
Expand Down

0 comments on commit 0ec41af

Please sign in to comment.