LCL: Prevent an exception with MouseDown on a Grid which lost focus. Issue #39730, patch by Soner.

This commit is contained in:
Juha 2022-05-18 00:12:31 +03:00
parent eeccdaa7fc
commit 7f199b0d44

View File

@ -6777,6 +6777,7 @@ begin
{$ENDIF} {$ENDIF}
if not Focused and not(csNoFocus in ControlStyle) then begin if not Focused and not(csNoFocus in ControlStyle) then begin
if CanFocus then
SetFocus; SetFocus;
if not Focused then begin if not Focused then begin
{$ifDef dbgGrid} DebugLnExit('TCustomGrid.MouseDown EXIT: Focus not allowed'); {$Endif} {$ifDef dbgGrid} DebugLnExit('TCustomGrid.MouseDown EXIT: Focus not allowed'); {$Endif}