LCL/Combobox: Fix hehavior when ESC or ENTER are pressed in dropped-down state. Issue #37674. Patch by jamie philbrook.

git-svn-id: trunk@63903 -
This commit is contained in:
wp 2020-09-21 12:10:31 +00:00
parent 6c19136b97
commit 39f9890864

View File

@ -1200,7 +1200,7 @@ class procedure TWin32WSCustomComboBox.SetDroppedDown(
const ACustomComboBox: TCustomComboBox; ADroppedDown: Boolean);
var
aSelStart, aSelLength: Integer;
aText: string;
aText: string = '';
Editable: Boolean;
OldItemIndex: Integer;
begin
@ -1217,7 +1217,8 @@ begin
OldItemIndex := GetItemIndex(ACustomComboBox);
SendMessage(ACustomComboBox.Handle, CB_SHOWDROPDOWN, WPARAM(ADroppedDown), 0);
SetItemIndex(ACustomComboBox, OldItemIndex);
if GetKeyState(VK_RETURN) < 0 then
SetItemIndex(ACustomComboBox, OldItemIndex);
if Editable then
begin