TCocoaSpinEdit.textDidEndEditing calls callback.SendOnTextChanged() even when text hasn't changed
Original Reporter info from Mantis: djenkins @dfjenkins
-
Reporter name: David Jenkins
Original Reporter info from Mantis: djenkins @dfjenkins
- Reporter name: David Jenkins
Description:
Current implementation of TCocoaSpinEdit.textDidEndEditing calls updateStepper and then StepperChanged. StepperChanged will call callback.SendOnTextChanged.
textDidEndEditing will be called when TCocoaSpinEdit loses focus - even if the text did not change. So we are getting calls down to LCL indicating the widget has changed value when it has not.
Steps to reproduce:
Create form with TSpinEdit. Click in SpinEdit so that it gains focus but do not change value. Click off form so that it looses focus. TCocoaSpinEdit.textDidEndEditing will be called.
Additional information:
I suggest two possible fixes
a) in TCocoaSpinEdit.textDidEndEditing check if self.stringValue is different than stepper.doublevalue (i.e. that value actually changed) and only call StepperChanged() if value changed.
b) get rid of textDidEndEditing of put a call to StepperChanged(nil) after call to updateStepper() in TCocoaSpinEdit.textDidChange.
In our current code I have implemented option 'b'/
Mantis conversion info:
- Mantis ID: 36578
- Version: 2.0.7 (SVN)
- Fixed in revision: 62562 (#4c6c4baf)