Skip to content

Commit ef4c6da

Browse files
committed
fix: restore scroll position in table editor after save
Closes #2578
1 parent bf88c06 commit ef4c6da

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎source/table_editor.pas‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,18 @@ procedure TfrmTableEditor.btnDiscardClick(Sender: TObject);
499499

500500

501501
procedure TfrmTableEditor.btnSaveClick(Sender: TObject);
502+
var
503+
ScrollOffset: TPoint;
502504
begin
503505
// Save changes, and make it impossible to (accidentally) click the save button twice
504506
btnSave.Enabled := False;
505507
btnSave.Repaint;
508+
// Remember scroll position, to restore it after re-init. See issue #2578
509+
ScrollOffset := listColumns.OffsetXY;
506510
if ApplyModifications = mrOK then begin
507511
// Initialize all edit fields with fresh result from SHOW TABLE STATUS row
508-
Init(MainForm.ActiveDbObj)
512+
Init(MainForm.ActiveDbObj);
513+
listColumns.OffsetXY := ScrollOffset;
509514
end else begin
510515
// Re-enable save button when something went wrong
511516
btnSave.Enabled := True;

0 commit comments

Comments
 (0)