Reputation: 47871
I have an angular ionic cordova app where I'm trying to trigger the click of an input from another span (so that I can trigger the native datetime keyboard in cordova) . However the click event doesn't seem to be triggered on the input field. Looking at the debugger, the click function of the document element is not null, but doesn't seem to do anything when triggered from the span. This works on a normal jsfiddle as commenters have noted, but when in an ionic environment, it doesn't - see this codepen
http://codepen.io/MonkeyBonkey/pen/OPmOrZ
<span onclick="document.getElementById('whenPickerInput').click();">
{{(when | amCalendar)}}
</span>
<input
onclick="alert('input clicked')"
id="whenPickerInput"
type="datetime-local"
ng-model="when" />
Upvotes: 1
Views: 2411
Reputation: 1238
You found a solution with <input data-tap-disabled="true" />
But better will be to change your code and don't use onclick. In Angular/Ionic u can use ng-click.
Upvotes: 0
Reputation: 47871
so it looks like ionic has it's own click handler that removes the 300ms delay in mobile. I have to remove that tap system for the input so that I can trigger the click event
http://ionicframework.com/docs/api/page/tap/
<input data-tap-disabled="true" />
Upvotes: 3