mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge branch 'main' into multiselect
This commit is contained in:
File diff suppressed because one or more lines are too long
20
tests/snapshot_tests/snapshot_apps/blur_on_disabled.py
Normal file
20
tests/snapshot_tests/snapshot_apps/blur_on_disabled.py
Normal 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()
|
||||
@@ -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"],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user