in Chrome 5.0.375.99 on MacOS X 10.5.8 I observe the same problem with
the 'c' shortcut. <Ctrl>+d and <Ctrl>+s don't work at all.
Yea, I've seen this and have yet to fix it. I do use Google Chrome,
but we're not forced to use it, or any other browser for that matter.
What's odd is, this seems like a bug in Chrome because IIRC these keys
worked in Safari. Safari and Chrome are both based on WebKit and tend
to have similar behaviors around such things. At least Chrome is
consistent between Linux and Mac OS X. :-)
I stopped trying to track the bug down because as far as I can tell,
the JavaScript code is correct for the event handling here. Chrome
just isn't giving me Ctrl-S or Ctrl-D when in the comment edit box,
and even though I canceled the "c" event when I made the comment edit
box, Chrome is still stuffing a "c" into it. It might be possible to
work around the "c" thing by testing to see if this is Chrome, and if
so, if the box contains just "c", and if so, delete the text. Ick.
GMail predates GWT and thus doesn't use it.
> I just tried this on Safari 5.0 (7533.16) in Windows, and I have
> exactly the same problem as Google Chrome, so it looks like maybe it's
> a problem with newer versions of WebKit?
Right, that's my thought.
> I'm happy to have a play around with this problem if you can point me
> to the code that handles the "<Ctrl> + s" event and the "c" event. My
> GWT mojo is very low (I've only done the Stock Watcher tutorial) so it
> would take me forever to find the correct line of code.
Look at the CommentEditorPanel class. On line 97 is where we are
trying to handle the key:
if ((event.isControlKeyDown() || event.isMetaKeyDown())
&& !event.isAltKeyDown() && !event.isShiftKeyDown()) {
switch (event.getCharCode()) {
case 's':
event.preventDefault();
onSave(NULL_CALLBACK);
return;
case 'd':
event.preventDefault();
if (isNew()) {
onDiscard();
} else if (Window.confirm(PatchUtil.C.confirmDiscard())) {
onDiscard();
} else {
text.setFocus(true);
}
return;
}
Thanks. This fix will be in 2.1.4.1, which I'm hoping to get out
early next week.