LCL: ComboBox: Fixed data lost, Style csSimple, leaving with TAB. Issue #35087. Patch by Gernot Riebold

git-svn-id: branches/fixes_2_0@63372 -
This commit is contained in:
mattias 2020-06-17 09:59:09 +00:00
parent 0dc7f8bbe1
commit eb3b58c86e

View File

@ -491,14 +491,12 @@ var
begin
Skip := False;
UserDropDown := ((Shift *[ssAlt] = [ssAlt]) and (Key = VK_DOWN));
PreventDropDown := Key in [VK_TAB, VK_RETURN, VK_ESCAPE];
if Style = csSimple then
PreventDropDown := Key in [VK_RETURN, VK_ESCAPE]
else
PreventDropDown := Key in [VK_TAB, VK_RETURN, VK_ESCAPE];
if PreventDropDown then
begin
// Prevent execution of DefaultAction (Delphi compatibility) except for
// style csSimple. There DroppedDown is always true (Delphi compatible).
// Tab key should work further and shouldn't be deleted. Issue #32559
if DroppedDown and not (Style = csSimple) then
Key := VK_UNKNOWN;
DroppedDown := False;
end;
// if AutoDropDown then don't close DropDown, like in Delphi, issue #31247