TWebListBox Sorting issue

Hi Bruno,

The demo state can be reset at any time by clicking the Reset List button. The TWebListBox Sorted property doesn't appear to operate correctly.

Pressing the button "ListBox Sorted = False":
When Sorted is set to False the list is sorted (unexpected) and the next item added to the list is appended to the end (expected). However, when additional items are added, they are inserted alphabetically (unexpected, also technically the list is not sorted because the first additional item was appended to the end).

Pressing the button "ListBox Sorted = True":
When Sorted is set to True the list is sorted (expected) and the next item added to the list is appended to the end (unexpected). However, when additional items are added, they are inserted alphabetically (expected, also technically the list is not sorted because the first additional item was appended to the end). Additionally, when Duplicates is dupIgnore, adding duplicate strings to the list is unexpected.

The buttons "Items Sorted = False" and "Items Sorted = True" perform the same operations as the first two buttons, except through the TWebListBox.Items object. I have not seen any inconsistencies with these properties so this is a workaround.

I was curious what was happening when Sorted was set to False and found this procedure in WEBLib.StdCtrls.pas:

procedure TListBox.SetSorted(const Value: Boolean);
begin
FSorted := Value;
TStringList(Items).Sort;
end;

It appears that the list is sorted regardless of whether Value is True or False. I currently have WEB Core 2.4.0.0 installed and I am using Delphi 10.4.

Here is the demo:
TMS-ListBox.zip (6.9 KB)

Thanks,

Thanks for reporting.
We have fixed this. Next update will address this.