Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Adobe Flex SDK 3.0 (Release)
-
None
-
None
-
Affected OS(s): Windows
Affected OS(s): Windows XP
Browser: Internet Explorer 7.x
Language Found: English
Description
Steps to reproduce:
1. Create an application with a default button (PFA source code for the sample app to reproduce the defect)
2. Have a check box and a button. Designate this button as the default button at the application level.
3. Create a click handler for the button, as simple as showing an Alert.
3. Run the application.
Actual Results:
The first time, when the check box gets focus, and you hit ENTER, you get the default behavior. The click handler of the button is invoked.
The second time, you focus the check box, and hit ENTER, the check box gets selected. You press ENTER again, the check box gets de-selected.
This continues from then on and the default button's click handler is never invoked again. This is both in IE 7 and Mozilla Firefox 3.0.1.
The defaultButton definition in the mx.core.Container API says that "The Button control designated as the default button for the container. When controls in the container have focus, pressing the Enter key is the same as clicking this Button control. "
Expected Results:
The click handler of the button should be invoked everytime. Since the button is the default button, no matter where the current focus is, one would expect the click handler of the button to be invoked, irrespective of the number of times.
Workaround (if any):
Capture the keyXXX events from the check box, and reset the selected value to true/false (the value before the ENTER was hit) and then invoke the default button's click handler.