Modal for opening a link in an app doesn't respect Escape or Enter
Reported by
johnbill...@gmail.com,
Aug 29 2017
|
|||||||
Issue descriptionUserAgent: 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:
,
Sep 15 2017
[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?
,
Sep 18 2017
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.
,
Sep 18 2017
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.
,
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).
,
Sep 18 2017
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.
,
Sep 19 2017
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.
,
Sep 19 2017
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.
,
Sep 19 2017
[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.
,
Sep 19 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by hdodda@chromium.org
, Aug 31 2017Labels: Needs-Triage-M60 Needs-Feedback