adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.25k stars 7.63k forks source link

[Core][Dialog]: Incorrect behaviour on dialogs if using keyboard to press the button. #6195

Open julieyuan opened 10 years ago

julieyuan commented 10 years ago

Steps:

  1. Launch Brackets on Win OS and open the default sample file.
  2. Edit the index.html file without saving.
  3. Close the file from Working set, then it will pop up the dialog Save Changes.
  4. Press the Tab key and observe the sequence.
  5. Tab to button Don't Save(or button Cancel ,x), then press Enter.
  6. Launch Brackets on Mac OS and open the default sample file.
  7. Repeat step2-5. Then reopen the index.html and observe the changes which you just edited.

Result: At step5, it will pop up dialog Error saving error. On Win OS, when press Tab key, the sequence is button Save> x > Don't Save > Cancel. At step5, when press those buttons, they work as button Save. After step7, the changes has been saved.On Mac OS, the sequece of Tab key is same with Win OS, but I think this is correct for MAC. At step7, those thress buttons also work as button 'Save'.

Expected: On Win OS, the sequence for Tab key should be Save> Cancel> Don't Save > x . At step5 and step7, it should close the index.html file successfully without saving.

Notes: This issue only happens when using keyboard. It works well if using the mouse to click the buttons. This issue reproduce in Sprint33. Same issue reproduces on other dialogs: Install Extension dialog, Switch Language, Project Settings.

ENV: MAC10.9 and Win8(x86) English OS Build: 0.35.0-10852 (master 84558879a)

Snapshots: Please refer to snapshots for details: 11 111

peterflynn commented 10 years ago

@julieyuan Can you clarify step 5? What do you mean "Press button ... with tab key"? Pressing Tab just moves focus to the next button. Are you instead pressing Space or Enter?

Judging by the behavior, I'm guessing you are pressing Enter -- currently, the Enter key always selects the default button (in blue), not the focused button. I think this is a bug but I remember it being discussed earlier so it may already be filed.

The error message on Windows is expected behavior when you select the Save button. See the user story "Getting Started outside of application root."

The tab order is clearly incorrect on Windows though, so we should at least keep the bug open to cover that issue.

julieyuan commented 10 years ago

@peterflynn Sorry for the unclear step and thank you for detailed information. Corrected step5 (original: Press button Don't Save(or button Cancel ,x) with Tab Key.).

njx commented 10 years ago

Low priority to @RaymondLim - feel free to reassign.