mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(tap): Remove 300ms delay when tapping select elements
This commit is contained in:
@@ -98,7 +98,8 @@ describe('Ionic Tap', function() {
|
||||
var targetEle = {
|
||||
dispatchEvent: function(clickEvent) {
|
||||
this.clickEvent = clickEvent;
|
||||
}
|
||||
},
|
||||
tagName: 'LABEL'
|
||||
};
|
||||
var e = { clientX: 99, clientY: 88 };
|
||||
ionic.tap.simulateClick(targetEle, e);
|
||||
|
||||
@@ -34,12 +34,7 @@
|
||||
// only climb up a max of 5 parents, anything more probably isn't beneficial
|
||||
if(!ele) break;
|
||||
|
||||
if( ele.tagName === "INPUT" ||
|
||||
ele.tagName === "A" ||
|
||||
ele.tagName === "BUTTON" ||
|
||||
ele.tagName === "LABEL" ||
|
||||
ele.tagName === "TEXTAREA" ) {
|
||||
|
||||
if( ele.tagName.match(/a|input|button|label|textarea|select/i) ) {
|
||||
return ionic.tap.simulateClick(ele, e);
|
||||
}
|
||||
ele = ele.parentElement;
|
||||
@@ -73,9 +68,12 @@
|
||||
|
||||
ele.dispatchEvent(clickEvent);
|
||||
|
||||
if(ele.tagName === 'INPUT' || ele.tagName === 'TEXTAREA') {
|
||||
if( ele.tagName.match(/input|textarea/i) ) {
|
||||
ele.focus();
|
||||
e.preventDefault();
|
||||
} else if( ele.tagName == 'SELECT' ) {
|
||||
// select simulateClick should not preventDefault or else no options dialog
|
||||
ele.focus();
|
||||
} else {
|
||||
ionic.tap.blurActive();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<title>Input: Select</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<link href="../../dist/css/ionic.css" rel="stylesheet">
|
||||
<script src="../../dist/js/ionic.bundle.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user