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

git-svn-id: trunk@63204 -
This commit is contained in:
michl 2020-05-21 22:15:42 +00:00
parent f48f7cee1a
commit 47ba57fd3a

View File

@ -490,14 +490,12 @@ begin
FEditingDone := Key = VK_RETURN;
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