Using Flex 4.5 SDK, I have a spark ComboBox and a Button next to it for applying a filter according to ComboBox selection.
I listen to both the ComboBox's change event & the Button's click event (for different functions).
When I manually delete the ComboBox text value from its TextInput (i.e. changing selected index to -1) and immediately click on the Button,
the click event-handler function is not being called and only the ComboBox's change event-handler function is executed.
(Selecting a value from the ComboBox's list and clicking on the button triggers both methods on the right order.)
There's also a state definition for the module, but it isn't being changed during these operations...
Is this a bug or a correct behavior? Am I missing something here?
Any workaround suggestions?
(I thought of listening also to mouse-down or mouse-up on the button instead, but haven't tried it yet...)
*** UPDATE ***
When using the Button's mouseDown event the behavior is as expected, so there's a simple workaround.
However, it seems to me like there's a bug with the Button's click event listener or something...
*** UPDATE #2 ***
I created a test application for that and couldn't reproduce the problem.
Then I figured out the problem and solved it.
It's a bit emmbarrasing, but I actually disabled the button (enabled=false) as in a child method of the change handling code...
(If there is no value, don't allow applying the filter - It makes sense! )
Anyway... No issue after all.
However, I choose to leave this post (and not delete it) as an example of identifying and resolving a strange behavior in a complex application.
Might be a bug. File a bug with a simple test case.
There's no need.
Please read the section UPDATE #2.