diff --git a/src/textual/widgets/_month_calendar.py b/src/textual/widgets/_month_calendar.py index a694a4bea7..e8c80a7f1a 100644 --- a/src/textual/widgets/_month_calendar.py +++ b/src/textual/widgets/_month_calendar.py @@ -102,8 +102,8 @@ def _on_datatable_cell_highlighted( date_coordinate = self._get_date_coordinate(self.date) table.cursor_coordinate = date_coordinate else: - row, column = event.coordinate - highlighted_date = self._calendar_dates[row][column] + cursor_row, cursor_column = event.coordinate + highlighted_date = self._calendar_dates[cursor_row][cursor_column] assert isinstance(highlighted_date, datetime.date) self.date = highlighted_date self.post_message(MonthCalendar.DateHighlighted(self, self.date)) @@ -250,8 +250,7 @@ def watch_date(self, old_date: datetime.date, new_date: datetime.date) -> None: self._update_calendar_table(update_week_header=False) else: table = self.query_one(DataTable) - cursor_row = table.cursor_coordinate.row - cursor_column = table.cursor_coordinate.column + cursor_row, cursor_column = table.cursor_coordinate if self._calendar_dates[cursor_row][cursor_column] != new_date: date_coordinate = self._get_date_coordinate(self.date) table.cursor_coordinate = date_coordinate