Description
This ticket documents the implementation of a sequence for the afterSetValue method in Neo.form.field.Base. The goal was to ensure that the change event consistently fires after the entire afterSetValue inheritance chain has completed.
Changes
src/form/field/Base.mjs:
- A
construct() method was added.
Util.Function.createSequence() is now used within construct() to sequence fireChangeEvent to run after the afterSetValue method.
- The direct call to
fireChangeEvent was removed from afterSetValue.
test/siesta/tests/form/field/AfterSetValueSequence.mjs:
- A new test file was created to verify the correct sequencing.
- It includes tests for both
Neo.form.field.Text and Neo.form.field.ComboBox.
- The tests confirm that the
change event fires after afterSetValue is complete.
Open Discussion Point
During testing, it was discovered that afterSetValue is called twice for both TextField and ComboBox due to a recursive loop between their value and inputValue configs.
While the primary goal of ensuring the change event fires only once and at the correct time has been achieved, the redundant afterSetValue call remains.
Description
This ticket documents the implementation of a sequence for the
afterSetValuemethod inNeo.form.field.Base. The goal was to ensure that thechangeevent consistently fires after the entireafterSetValueinheritance chain has completed.Changes
src/form/field/Base.mjs:construct()method was added.Util.Function.createSequence()is now used withinconstruct()to sequencefireChangeEventto run after theafterSetValuemethod.fireChangeEventwas removed fromafterSetValue.test/siesta/tests/form/field/AfterSetValueSequence.mjs:Neo.form.field.TextandNeo.form.field.ComboBox.changeevent fires afterafterSetValueis complete.Open Discussion Point
During testing, it was discovered that
afterSetValueis called twice for bothTextFieldandComboBoxdue to a recursive loop between theirvalueandinputValueconfigs.While the primary goal of ensuring the
changeevent fires only once and at the correct time has been achieved, the redundantafterSetValuecall remains.