From e1be13f4b7acb9336593b13df50601aa7ebe2bf0 Mon Sep 17 00:00:00 2001 From: rich2014 Date: Sun, 21 Jul 2024 14:57:12 +0800 Subject: [PATCH] Cocoa/ListView: fix the issue that multiple selections could not be retained when switching viewStyle --- lcl/interfaces/cocoa/cocoawscomctrls.pas | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lcl/interfaces/cocoa/cocoawscomctrls.pas b/lcl/interfaces/cocoa/cocoawscomctrls.pas index 16b6b82f33..0a12785768 100644 --- a/lcl/interfaces/cocoa/cocoawscomctrls.pas +++ b/lcl/interfaces/cocoa/cocoawscomctrls.pas @@ -1351,6 +1351,9 @@ begin if NOT Assigned(lclcb) then Exit; + if TCocoaListView(lclcb.Owner).initializing then + Exit; + lclcb.selectionIndexSet.removeAllIndexes; _collectionView.reloadData(); end;