New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 760118 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug
M-4



Sign in to add a comment

Modal for opening a link in an app doesn't respect Escape or Enter

Reported by johnbill...@gmail.com, Aug 29 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36

Steps to reproduce the problem:
1. Visit a URL which prompts the user to open the link in an app on their OS. For example, a link to a Slack message when the user has the Slack app installed.
2. Observe that the "Open Slack.app?" modal appears.
3. Press "Escape" or "Enter" to perform the affirmative or negative action.

What is the expected behavior?
The Escape and Enter keys correspond to "Don't open" and "Open Slack.app", respectively.

What went wrong?
The Escape and Enter keys have no effect.

Did this work before? N/A 

Chrome version: 60.0.3112.101  Channel: n/a
OS Version: OS X 10.12.3
Flash Version:
 

Comment 1 by hdodda@chromium.org, Aug 31 2017

Cc: hdodda@chromium.org
Labels: Needs-Triage-M60 Needs-Feedback
Thanks for reporting the issue.

@johnbillion-- Could you please provide us the sample test url or test application to reproduce the issue and also please help us with the screencast of expected result/Actual issue.

Thanks!

Comment 2 by shrike@chromium.org, Sep 15 2017

Labels: -Type-Bug -Pri-2 ReleaseBlock-Stable M-62 Pri-1 Type-Bug-Regression
Owner: dominickn@chromium.org
[mac bug triage] Repro steps:

1. Go to https://itunes.apple.com/us/app/fetch/id407963172?mt=12
2. Click View in Mac App Store button

I marked this as a regression but I don't know for certain that it worked originally. Marking it RBS for now (depends on how hairy it is to fix).

dominickn@ - I believe you are the correct assignee?
Cc: tapted@chromium.org shrike@chromium.org
Labels: -Pri-1 -ReleaseBlock-Stable Pri-2
This is impossible to fix without a bunch of work - namely replacing the entire dialog.

I discovered that NSAlert (which the dialog uses) will wire up Esc to respond to "Cancel" if and only if the string for the button is "Cancel". I imagine there's some similar behaviour for the primary button. (https://bugs.chromium.org/p/chromium/issues/detail?id=671658#c46)

Removing RBS and lowering priority for now.
Oops, submitted too early. To finish the thought, I did some exploration and couldn't find a way to wire up buttons to Esc/Enter in NSAlert aside from the default magic routing.

The "Don't open" button is changing back to Cancel in an upcoming release so "Esc" will work again to cancel the dialog. But getting Enter to work for the primary button will require replacing the dialog wholesale.

Comment 5 by tapted@chromium.org, Sep 18 2017

Setting keyEquivalents to \e or \r (or constants from key_equivalent_constsnts.h) should work . E.g. https://cs.chromium.org/chromium/src/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm?q=keyequivalent+javascript&sq=package:chromium&l=306

(we generally can't rely on the NSAlert magicness for the string "Cancel" since I doubt it is robust to translations).

Comment 6 by shrike@chromium.org, Sep 18 2017

Labels: -Pri-2 ReleaseBlock-Stable Pri-1
Status: Assigned (was: Unconfirmed)
Given that this should just be a matter of setting the key equivalent strings, and that the current dialog is really broken, bumping back to Pri-1 RBS.
tapted, shrike: thanks for the advice on this. I'm currently out of office so I can't address this until next week at the earliest.

Comment 8 by tapted@chromium.org, Sep 19 2017

Cc: benwells@chromium.org
Labels: -ReleaseBlock-Stable -Type-Bug-Regression Type-Bug
Status: Fixed (was: Assigned)
Coincidentally, ben just fixed this in r499865.

Before that, this dialog had

  [allowButton setKeyEquivalent:@""];  // disallow as default

since r28145 (8 years ago). Dom's change for  Issue 601725  didn't change that.

Ben's change makes the string "Cancel" and makes allowButton default, so this bug is already fixed, at least for for US-English and maybe others. --secondary-ui-md will make the Esc-mapping not depend on strings.
Labels: Merge-TBD
[Auto-generated comment by a script] We noticed that this issue is targeted for M-62; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-62 label, otherwise remove Merge-TBD label. Thanks.
Labels: -Merge-TBD -M-62 M-4

Sign in to add a comment