fix focus glitch

This commit is contained in:
Will McGugan
2022-10-17 15:13:08 +01:00
parent 73e698dc36
commit b88da06174
3 changed files with 7 additions and 4 deletions

View File

@@ -25,13 +25,13 @@ You can install Textual via PyPI.
If you plan on developing Textual apps, then you should install `textual[dev]`. The `[dev]` part installs a few extra dependencies for development. If you plan on developing Textual apps, then you should install `textual[dev]`. The `[dev]` part installs a few extra dependencies for development.
``` ```
pip install "textual[dev]==0.2.0b6" pip install "textual[dev]==0.2.0b7"
``` ```
If you only plan on _running_ Textual apps, then you can drop the `[dev]` part: If you only plan on _running_ Textual apps, then you can drop the `[dev]` part:
``` ```
pip install textual==0.2.0b6 pip install textual==0.2.0b7
``` ```
!!! important !!! important

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "textual" name = "textual"
version = "0.2.0b6" version = "0.2.0b7"
homepage = "https://github.com/Textualize/textual" homepage = "https://github.com/Textualize/textual"
description = "Modern Text User Interface framework" description = "Modern Text User Interface framework"
authors = ["Will McGugan <will@textualize.io>"] authors = ["Will McGugan <will@textualize.io>"]

View File

@@ -1850,7 +1850,10 @@ class Widget(DOMNode):
def set_focus(widget: Widget): def set_focus(widget: Widget):
"""Callback to set the focus.""" """Callback to set the focus."""
widget.screen.set_focus(self, scroll_visible=scroll_visible) try:
widget.screen.set_focus(self, scroll_visible=scroll_visible)
except NoScreen:
pass
self.app.call_later(set_focus, self) self.app.call_later(set_focus, self)