Merge branch 'main' into multiselect

This commit is contained in:
Dave Pearson
2023-05-25 10:04:52 +01:00
10 changed files with 264 additions and 77 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
from textual.app import App, ComposeResult
from textual.widgets import Input
class BlurApp(App):
BINDINGS = [("f3", "disable")]
def compose(self) -> ComposeResult:
yield Input()
def on_ready(self) -> None:
self.query_one(Input).focus()
def action_disable(self) -> None:
self.query_one(Input).disabled = True
if __name__ == "__main__":
app = BlurApp()
app.run()

View File

@@ -514,3 +514,11 @@ def test_select_rebuild(snap_compare):
SNAPSHOT_APPS_DIR / "select_rebuild.py",
press=["space", "escape", "tab", "enter", "tab", "space"],
)
def test_blur_on_disabled(snap_compare):
# https://github.com/Textualize/textual/issues/2641
assert snap_compare(
SNAPSHOT_APPS_DIR / "blur_on_disabled.py",
press=[*"foo", "f3", *"this should not appear"],
)