webview in win 10 universal apps doubletapped vs doubleclick

188 Views Asked by At

I have a webpage with javascript code reacting on dblclick, for example on a "paragraph p" Element. I attach also a dblclick in a tinymce editor.

It works fine, if it is in a browser and if it is in a c# webview in a win 10 universal app.

If I start it in the visual studio simulator and input is mousemode it works as expected, but if I change to touchmode double tap selects a word. My javascript is not executing. My javascript is working if a double tap creates not a selection. For example tapping between the words. But very mostly double tapping creates a selection of a word.

So how can I stop my Webview selecting words on touch and execute my javascript?

If selecting can not stopped, what must i do that my javascript will execute?

Any Idea?

Thanks in advance, Basilius

Update: Visual Studio 2015 c# universal app, webview in xaml, load html file by mywebview.Navigate(new Uri to html file)

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title></title>
<script>
function double() {
document.getElementById('idTapped').innerHTML = "double Tapped";
}
</script>

<script>
function single() {
document.getElementById('idTapped').innerHTML = "single Tapped";
}
</script>

</head>

<body>

<div id="content">

<p onclick="single()" >
This is a demo for single tap.
</p>

<p ondblclick="double()">
Double Tap select word and will not execute demo in VS Simulator using touch input.
</p>

<p id="idTapped">How many Taps</p>

</div>

</body>
<html>

With mouse it works in Browser, in universal app, in VS simulator, but if you choose in VS Simulator touch input double tap will not execute ondblclick. If you try to tap between the words, you maybe lucky and ondblclick will execute. But if double tap will select a word it won't work.

Is ther a solution that double tap will execute always?.

Thanks in advance, Basil

1

There are 1 best solutions below

0
On

Windows can react on a click as on a tap, but not back. So if you set doubleClick event, but don't set doubleTap event- it use base doubleTap event - selecting a word. Try to set your code for doubleTap event, and it should work on doubleTap and doubleClick.