Fix search input stealing focus on app launch - explicitly focus main widget
This commit is contained in:
@@ -236,6 +236,9 @@ class CalendarApp(App):
|
|||||||
self._update_status()
|
self._update_status()
|
||||||
self._update_title()
|
self._update_title()
|
||||||
|
|
||||||
|
# Focus the week grid (not the hidden search input)
|
||||||
|
self.query_one("#week-grid", WeekGrid).focus()
|
||||||
|
|
||||||
def _on_ipc_message(self, message: IPCMessage) -> None:
|
def _on_ipc_message(self, message: IPCMessage) -> None:
|
||||||
"""Handle IPC messages from sync daemon."""
|
"""Handle IPC messages from sync daemon."""
|
||||||
if message.event == "refresh":
|
if message.event == "refresh":
|
||||||
|
|||||||
@@ -315,6 +315,9 @@ class TasksApp(App):
|
|||||||
# Load tasks (filtered by current filters)
|
# Load tasks (filtered by current filters)
|
||||||
self.load_tasks()
|
self.load_tasks()
|
||||||
|
|
||||||
|
# Focus the task table (not the hidden search input)
|
||||||
|
table.focus()
|
||||||
|
|
||||||
def _setup_columns(self, table: DataTable, columns: list[str]) -> None:
|
def _setup_columns(self, table: DataTable, columns: list[str]) -> None:
|
||||||
"""Setup table columns with dynamic widths based on available space."""
|
"""Setup table columns with dynamic widths based on available space."""
|
||||||
# Minimum widths for each column type
|
# Minimum widths for each column type
|
||||||
|
|||||||
Reference in New Issue
Block a user