Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334403

Summary: [client] [editor] [Safari] [IE] Ctrl+O incorrectly triggers default browser behavior
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, Silenio_Quarti
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2011-01-14 12:39:19 EST
Build Identifier: 0.2

Using Safari 5.0.2 (Win) or Internet Explorer 9

Reproducible: Always

Steps to Reproduce:

1. Log into Orion
2. Open the editor on a file.
3. Press Ctrl+O. The outline pane is toggled (as expected), but you also see the Open dialog from the browser.
Comment 1 Mark Macdonald CLA 2011-01-26 14:06:34 EST
> 1. Log into Orion
> 2. Open the editor on a file.
> 3. Press Ctrl+O. The outline pane is toggled (as expected), but you also see
> the Open dialog from the browser.

Something similar happens with Ctrl+F -- you see our "find" prompt, but the browser's Find Toolbar opens too.
Comment 2 Felipe Heidrich CLA 2011-01-27 14:41:36 EST
The code running is correct.

It seems that stopping keydown events on IE (and win-safari too) does not work (the default handler always runs). Maybe this is by design: IE will not let javascript stop the browser's key binding (such as Ctrl+N, Ctrl+F) - in a way, it makes sense to me.
Comment 3 Mark Macdonald CLA 2011-01-27 16:03:43 EST
Google Docs somehow found a way to do this, eg. Ctrl+S saves your document rather than opening the IE Save dialog. I'm not sure what kind of tricks they're using, but hopefully we can do the same.
Comment 4 Felipe Heidrich CLA 2011-01-27 16:28:19 EST
We stop Ctrl+S too, try it out. Our code that stops Ctrl+S won't stop Ctrl+O and Ctrl+F.
Comment 5 Felipe Heidrich CLA 2011-01-27 16:33:24 EST
Awesome, that works http://stackoverflow.com/questions/3618613/suppress-default-handling-of-ctrlo-in-internet-explorer

changing the keyCode is hacky but works, I'll release after M5 so we dont break anything in the release.
Comment 6 Felipe Heidrich CLA 2011-02-01 12:18:55 EST
Fixed.