Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textual v0.14.0 compat #12

Merged
merged 2 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ packages = [{ include = "textual_autocomplete" }]
[tool.poetry.dependencies]
python = "^3.7.8"
#textual = {path="../textual", develop=true}
textual = "^0.11.0"
textual = ">=0.14.0"
typing-extensions = "^4.5.0"

[tool.poetry.group.dev.dependencies]
mypy = "^0.991"
black = "^22.10.0"
#textual = { version = "^0.10.0", extras = ["dev"] }
textual = { version = "^0.11.0", extras = ["dev"] }
textual = { version = ">=0.14.0", extras = ["dev"] }
ward = { version = "^0.67.2b0", allow-prereleases = true }

[build-system]
Expand Down
10 changes: 5 additions & 5 deletions textual_autocomplete/_autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ def _select_item(self):
self.input.cursor_position = new_state.cursor_position

self.dropdown.display = False
self.post_message_no_wait(
self.Selected(self, item=self.dropdown.selected_item)
self.post_message(
self.Selected(item=self.dropdown.selected_item)
)

class Selected(Message):
def __init__(self, sender: MessageTarget, item: DropdownItem):
super().__init__(sender)
def __init__(self, item: DropdownItem):
super().__init__()
self.item = item


Expand All @@ -264,7 +264,7 @@ class Dropdown(Widget):
}

Dropdown .autocomplete--selection-cursor {
background: $boost 8%;
background: $boost;
}
"""

Expand Down