Skip to content
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
2 changes: 1 addition & 1 deletion src/textual/dom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ def _update_styles(self) -> None:

Should be called whenever CSS classes / pseudo classes change.
"""
if not self.is_attached:
if not self.is_attached or not self.screen.is_mounted:
return
try:
self.app.update_styles(self)
Expand Down
4 changes: 4 additions & 0 deletions src/textual/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,10 @@ def _on_screen_resume(self) -> None:
self._refresh_layout(size)
self.refresh()

async def _compose(self) -> None:
await super()._compose()
self._update_auto_focus()

def _update_auto_focus(self) -> None:
"""Update auto focus."""
if self.app.app_focus:
Expand Down
6 changes: 4 additions & 2 deletions src/textual/widgets/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -1782,12 +1782,14 @@ def _restart_blink(self) -> None:
"""Reset the cursor blink timer."""
if self.cursor_blink:
self._cursor_visible = True
self.blink_timer.reset()
if self.is_mounted:
self.blink_timer.reset()

def _pause_blink(self, visible: bool = True) -> None:
"""Pause the cursor blinking but ensure it stays visible."""
self._cursor_visible = visible
self.blink_timer.pause()
if self.is_mounted:
self.blink_timer.pause()

async def _on_mouse_down(self, event: events.MouseDown) -> None:
"""Update the cursor position, and begin a selection using the mouse."""
Expand Down
Loading