Commit 3795c04d authored by fukino@chromium.org's avatar fukino@chromium.org

Do not call event.preventDefault() on touchstart for menu items.

preventDefault() on 'touchstart' prevents tap operation from dispatching click-like events.
On 'touchstart', preventDefault() should not be called.

BUG=374177
TEST=manually tested

Review URL: https://codereview.chromium.org/284233007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271204 0039d316-1c4b-4281-b951-d872f2087c98
parent 67f92942
...@@ -151,12 +151,17 @@ cr.define('cr.ui', function() { ...@@ -151,12 +151,17 @@ cr.define('cr.ui', function() {
switch (e.type) { switch (e.type) {
case 'mousedown': case 'mousedown':
case 'touchstart':
if (!this.menu.contains(e.target)) if (!this.menu.contains(e.target))
this.hideMenu(); this.hideMenu();
else else
e.preventDefault(); e.preventDefault();
break; break;
case 'touchstart':
if (!this.menu.contains(e.target))
this.hideMenu();
break;
case 'keydown': case 'keydown':
// keyIdentifier does not report 'Esc' correctly // keyIdentifier does not report 'Esc' correctly
if (e.keyCode == 27 /* Esc */) { if (e.keyCode == 27 /* Esc */) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment