diff --git a/tabulous/_qt/_table/_base/_enhanced_table.py b/tabulous/_qt/_table/_base/_enhanced_table.py index 4b95a4a..63c1d8b 100644 --- a/tabulous/_qt/_table/_base/_enhanced_table.py +++ b/tabulous/_qt/_table/_base/_enhanced_table.py @@ -254,8 +254,13 @@ def _on_moved(self, src: Index, dst: Index) -> None: model = self.model() index_src = model.index(*src.as_uint()) index_dst = model.index(*dst.as_uint()) - if dst >= (0, 0) and self.hasFocus(): - self.scrollTo(index_dst) + if dst >= (0, 0): + if self.hasFocus(): + self.scrollTo(index_dst) + elif dst.row < 0: + self.scrollTo(model.index(0, dst.column)) + elif dst.column < 0: + self.scrollTo(model.index(dst.row, 0)) # rect is the region that needs to be updated rect: QtCore.QRect = self.visualRect(index_dst)