Skip to content

Commit

Permalink
fix bug where a selection with a mouse click did select the last item…
Browse files Browse the repository at this point in the history
…, not the selected one. closes #2
  • Loading branch information
mitosch committed Mar 13, 2023
1 parent e6051c7 commit 8afe9ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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-select"
version = "0.3.0"
version = "0.3.1"
description = "A select widget (aka dropdown) for Textual."
authors = ["Mischa Schindowski <[email protected]>"]
readme = "README.md"
Expand Down
4 changes: 3 additions & 1 deletion textual_select/_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def __init__(
def on_blur(self) -> None:
self.select_list.display = False

def on_click(self, event: events.MouseEvent) -> None:
def on_list_item__child_clicked(self, event: ListItem._ChildClicked) -> None:
super().on_list_item__child_clicked(event)

self.select_list.select_highlighted_item()
self.select_list.display = False

Expand Down

0 comments on commit 8afe9ef

Please sign in to comment.