When you double click an input field the Paste
option appears. This is expected behavior if you have something in your clipboard.
However, I would like to enable the scenario where user is holding on the input box (onHold event) so that it then pops up the Paste
option.
I successfully detect the onHold event, but I can’t seem to simulate the double tap (or a single tap for that matter) which would then (hopefully) trigger the Paste
tooltip to appear.
In a sea of examples I’ve tried, I’m listing this one:
$scope.onHold = function() {
$timeout(function() {
var e = document.getElementById('lookupInput');
e.select();
ionic.trigger('doubletap', { target: e });
}, 100);
};
onHold
function is called on the div element:
<div on-hold="onHold()">
<input type="text" ng-model="my.data" id="lookupInput">
</div>
I must be missing something, as e.select();
does put the focus in that input box, but e.click()
does (seemingly) nothing.
So, any help here would be appreciated!