Commit d3396e9f authored by Werner Pamler's avatar Werner Pamler
Browse files

LCL/Listview: Fix listview jumping to first item when a key is pressed in...

LCL/Listview: Fix listview jumping to first item when a key is pressed in virtual mode, issue #39715.
parent 8c556536
......@@ -233,6 +233,26 @@ var
end;
end;
{ Workaround for issue #39715 to prevent the selection jumping to the first
item in virtual mode when a normal key is pressed (the listview probably
tries to perform an incremental search in this case which has not been
implemented, yet (handler for OnDataFind). }
procedure HandleListViewFindItem(ALV: TCustomlistViewAccess);
var
FindInfo: PNMLVFindItem;
listitem: TListItem;
begin
if ALV.OwnerData then
begin
FindInfo := PNMLVFindItem(NMHdr);
if Assigned(FindInfo) then
begin
MsgResult := -1;
WinProcess := false;
end;
end;
end;
begin
Result := False;
case Msg of
......@@ -247,6 +267,8 @@ begin
if ListViewWindProcInfo.ActiveListView = AWinControl then
ListViewWindProcInfo.NoMouseUp := True;
end;
LVN_ODFINDITEM:
HandleListViewFindItem(TCustomListViewAccess(AWinControl));
end;
end;
end;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment