diff --git a/lcl/grids.pas b/lcl/grids.pas index fa3e0d798d..eb288b44c9 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -6848,9 +6848,9 @@ var procedure MoveSel(Rel: Boolean; aCol,aRow: Integer); begin - // Always reset Offset in keyboard Events - FGCache.TLColOff:=0; - FGCache.TLRowOff:=0; + // Do not reset Offset in keyboard Events - see issue #29420 + //FGCache.TLColOff:=0; + //FGCache.TLRowOff:=0; SelectActive:=Sh; Include(FGridFlags, gfEditingDone); if MoveNextSelectable(Rel, aCol, aRow) then @@ -7179,19 +7179,17 @@ begin FRow := DRow; MoveSelection; + SelectEditor; - if EditorAlwaysShown then begin - SelectEditor; + if (FEditor<>nil) and EditorAlwaysShown then begin // if editor visibility was changed on BeforeMoveSelection or MoveSelection // make sure editor will be updated. // TODO: cell coords of last time editor was visible // could help here too, if they are not the same as the // current cell, editor should be hidden first too. - if FEditor<>nil then begin - if FEditor.Visible then - EditorHide; - EditorShow(true); - end; + if FEditor.Visible then + EditorHide; + EditorShow(true); end; {$IfDef dbgGrid}DebugLnExit('MoveExtend END FCol= ',IntToStr(FCol), ' FRow= ',IntToStr(FRow));{$Endif}