mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 13:38:00 +02:00
Cocoa: Fix ItemIndex issue of TComboBox with csDropDownList at init
This commit is contained in:
parent
d019706897
commit
f3d26660e7
@ -489,6 +489,10 @@ begin
|
||||
end else
|
||||
FOwner.insertItemWithTitle_atIndex(astr, Index);
|
||||
|
||||
// ItemIndex may be changed in addItemWithTitle() / insertItemWithTitle_atIndex()
|
||||
// keep compatibility with LCL by resetting ItemIndex
|
||||
FOwner.selectItemAtIndex(FOwner.lastSelectedItemIndex);
|
||||
|
||||
mn := FOwner.itemAtIndex(Index);
|
||||
if not Assigned(mn) then Exit;
|
||||
|
||||
@ -1589,7 +1593,7 @@ begin
|
||||
if Assigned(selectedItem) then
|
||||
Result:=selectedItem.title
|
||||
else
|
||||
Result:=inherited stringValue;
|
||||
Result:=NSString.string_;
|
||||
end;
|
||||
|
||||
procedure TCocoaReadOnlyComboBox.drawRect(dirtyRect: NSRect);
|
||||
|
Loading…
Reference in New Issue
Block a user