diff --git a/CHANGELOG.md b/CHANGELOG.md index 475d8ff..77f4266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Bug Fixes - Fixes an issue where uncommenting a line using the uncomment action could indent the line by an additional space ([#616](https://github.com/tconbeer/harlequin/issues/616) - thank you [@harrymconner](https://github.com/harrymconner)!). +- The (empty) results viewer will no longer be focused after executing only DDL queries (queries that do not return any data) ([#609](https://github.com/tconbeer/harlequin/issues/609)). ## [1.23.1] - 2024-07-23 diff --git a/src/harlequin/app.py b/src/harlequin/app.py index 0ba3e59..9e5743e 100644 --- a/src/harlequin/app.py +++ b/src/harlequin/app.py @@ -563,7 +563,8 @@ async def load_tables(self, message: ResultsFetched) -> None: self.results_viewer.show_table(did_run=False) else: self.results_viewer.show_table(did_run=True) - self.results_viewer.focus() + if message.data: + self.results_viewer.focus() @on(WidgetMounted) def bind_keys(self, message: WidgetMounted) -> None: