If initial is not set for an input, the state vector shows undefined even though the UI makes a selection (whether that's halfway through the range, the color #123456, or a blank string). The result is an inconsistent UI vs. state. Of course it's correct once the input is perturbed, but it remains incorrect if a different input is perturbed.
This PR adds an internal 'initialized' event that each component calls (asynchronously, seems it needs to be) so that the initialized value is read and inserted into the state object as soon as the control panel is initialized. This does not trigger an 'input' event. Let me know if this makes sense! Thanks!
If
initial
is not set for an input, the state vector showsundefined
even though the UI makes a selection (whether that's halfway through the range, the color#123456
, or a blank string). The result is an inconsistent UI vs. state. Of course it's correct once the input is perturbed, but it remains incorrect if a different input is perturbed.This PR adds an internal
'initialized'
event that each component calls (asynchronously, seems it needs to be) so that the initialized value is read and inserted into the state object as soon as the control panel is initialized. This does not trigger an'input'
event. Let me know if this makes sense! Thanks!