Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49526

How to trigger a double tap on an input in Ionic framework?

$
0
0

@Hitman666 wrote:

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!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49526

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>