Skip to content

Commit

Permalink
Fix an issue with focus getting lost inside a Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
talblubClouby96 authored and davep committed Apr 26, 2023
1 parent 72b8d4f commit b079627
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frogmouth/screens/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ def visit(self, location: Path | URL, remember: bool = True) -> None:
async def on_mount(self) -> None:
"""Set up the main screen once the DOM is ready."""

# Currently Textual's Markdown can steal focus, which gets confusing
# as it's not obvious *what* is focused. So let's stop it from
# allowing the content to get focus.
#
# https://github.com/Textualize/textual/issues/2380
self.query_one(Markdown).can_focus_children = False

# Load up any history that might be saved.
if history := load_history():
self.query_one(Viewer).load_history(history)
Expand Down

0 comments on commit b079627

Please sign in to comment.