mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 18:08:35 +02:00
Cocoa: Fix the issue that KillFocus message is sent to the wrong control when the control is a FieldEditor #40635
This commit is contained in:
parent
f813f574d4
commit
4746c886bd
@ -1027,6 +1027,12 @@ begin
|
||||
newResponder := getProperFocusedResponder( self, aResponder );
|
||||
if lastResponder = newResponder then exit;
|
||||
|
||||
// get the callback of lastResponder first, because the callback of
|
||||
// lastResponder may be changed dynamically.
|
||||
// for example, when lastResponder is a FieldEditor.
|
||||
// see also: TCocoaFieldEditor.lclGetCallback()
|
||||
cb := getResponderCallback( lastResponder );
|
||||
|
||||
// do toggle Focused Control
|
||||
// Result=false when the focused control has not been changed
|
||||
// TCocoaWindow.makeFirstResponder() may be triggered reentrant here
|
||||
@ -1038,7 +1044,6 @@ begin
|
||||
exit;
|
||||
|
||||
// 1st: send KillFocus Message first
|
||||
cb:= getResponderCallback( lastResponder );
|
||||
if Assigned(cb) then
|
||||
cb.ResignFirstResponder;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user