Bug 405095 - "datetimepicker suppresses most keyboard shortcuts" [p=ynvich@gmail.com (Sergey Yanovich) r=gavin r=Enn a1.9b3=beltzner]

This commit is contained in:
reed@reedloden.com 2008-01-31 01:41:17 -08:00
parent 5216578546
commit 03c24b4c64
2 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,12 @@
<datepicker id="datepicker-grid" type="grid"/>
</hbox>
<keyset id="mainKeyset">
<key id="key_alt_e" key="E" oncommand="return" modifiers="alt"/>
<key id="key_ctrl_s" key="S" oncommand="return" modifiers="control"/>
<key id="key_meta_e" key="E" oncommand="return" modifiers="meta"/>
</keyset>
<body xmlns="http://www.w3.org/1999/xhtml">
<p id="display"></p>
<div id="content" style="display: none">
@ -182,6 +188,10 @@ function testtag_datepicker_UI_fields(dp, testid)
testtag_datepicker_UI_key(dp, testid, "2003-02-28", dp.dateField, 2003, 1, 1, 2003, 1, 28);
testtag_datepicker_UI_key(dp, testid, "2004-02-28", dp.dateField, 2004, 1, 29, 2004, 1, 28);
testtag_datepicker_UI_key(dp, testid, "2100-02-28", dp.dateField, 2100, 1, 1, 2100, 1, 28);
synthesizeKeyExpectEvent('E', { altKey: true }, $("key_alt_e"), "command", testid + " alt shortcut");
synthesizeKeyExpectEvent('S', { ctrlKey: true }, $("key_ctrl_s"), "command", testid + " ctrl shortcut");
synthesizeKeyExpectEvent('E', { metaKey: true }, $("key_meta_e"), "command", testid + " meta shortcut");
}
function testtag_datepicker_UI_grid(dp, type, testid)

View File

@ -217,6 +217,7 @@
<![CDATA[
if (this._hasEntry && event.charCode &&
this._currentField != this._fieldAMPM &&
! (event.altKey || event.ctrlKey || event.metaKey) &&
(event.charCode < 48 || event.charCode > 57))
event.preventDefault();
]]>