View Issue Details

IDProjectCategoryView StatusLast Update
0036578LazarusWidgetsetpublic2020-01-16 02:52
ReporterDavid Jenkins Assigned ToDmitry Boyarintsev  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.0.7 (SVN) 
Summary0036578: TCocoaSpinEdit.textDidEndEditing calls callback.SendOnTextChanged() even when text hasn't changed
DescriptionCurrent 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 ReproduceCreate 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 InformationI 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'/
TagsNo tags attached.
Fixed in Revision62562
LazTarget-
WidgetsetCocoa
Attached Files

Activities

Dmitry Boyarintsev

2020-01-16 02:52

developer   ~0120470

please test and close if ok

Issue History

Date Modified Username Field Change
2020-01-14 19:00 David Jenkins New Issue
2020-01-16 02:52 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2020-01-16 02:52 Dmitry Boyarintsev Status new => resolved
2020-01-16 02:52 Dmitry Boyarintsev Resolution open => fixed
2020-01-16 02:52 Dmitry Boyarintsev Fixed in Revision => 62562
2020-01-16 02:52 Dmitry Boyarintsev LazTarget => -
2020-01-16 02:52 Dmitry Boyarintsev Widgetset Cocoa => Cocoa
2020-01-16 02:52 Dmitry Boyarintsev Note Added: 0120470