JavaScript listening for touchend sometimes fires click event mobile

I have an app im building with phonegap.

I'm listening for touchstart/ touchend events to make it responsive.

Sometimes, the event listener for the touchend will fire, but then, for e.g, an input will focus afterwards as the click event is fired 300ms later.

an example is, i have a menu sidebar. each sidebar list item listens to the touchend event. on receiving the event, the sidebar closes and the relevant page is shown. however, if the relevant page contains a form element that is where the user had clicked for the sidebar list item, the form element will get focused.

what is the best way to stop this across the entire app? it happens in various scenarios which vary with different phones.

Ive tried things like stopPropagation etc but these only work ina few cases, and i need to have a generic cross-app solution rather than adding in for each function, if possible.

something like:

$('body').on('touchend', function(){
    //stop any further touchends/ clicks from firing
    //apart from the 1 i do want
})
Answer:1

You could try 'touchcancel' instead of 'touchend', see if it works :) good luck.

Answer:2

so I'm using innerHTML to try to add a dom element with a count variable, I'm console.logging the dom element and the property innerHTML changed to what I want, but it's not rendering to the page/ ...

so I'm using innerHTML to try to add a dom element with a count variable, I'm console.logging the dom element and the property innerHTML changed to what I want, but it's not rendering to the page/ ...

  1. innerhtml property of element

I am a novice at Javascript. But I have to use it in one of my projects. I have a tabbed control that sets the value of a hidden control from various events on the page (tab clicks and dropdowns). ...

I am a novice at Javascript. But I have to use it in one of my projects. I have a tabbed control that sets the value of a hidden control from various events on the page (tab clicks and dropdowns). ...

  1. what difference between bourbon and whiskey
  2. what difference between vegan and vegetarian
  3. what difference between psoriasis and eczema
  4. what difference between flu a and b
  5. what difference between ipad and ipad air
  6. what difference between republic and democracy
  7. what difference between inc and llc
  8. what difference between chromebook and laptop
  9. what difference between md and do
  10. what difference between virus and bacteria
  11. what difference between w2 and w4
  12. what difference between perfume and eau de toilette
  13. what difference between cold and flu
  14. what difference between catholic and christian
  15. what difference between diabetes 1 and 2
  16. what difference between california king and king
  17. what difference between macbook air and pro
  18. what difference between airpod 1 and 2
  19. what difference between medicare and medicaid
  20. what difference between bipolar 1 and 2

I display a list by using the v-repeat directive. http://jsfiddle.net/ftc9ev7p/1/ Please notice the dynamically created argument of the v-el directive, which is made of v-el="inputField{{task.id}}"...

I display a list by using the v-repeat directive. http://jsfiddle.net/ftc9ev7p/1/ Please notice the dynamically created argument of the v-el directive, which is made of v-el="inputField{{task.id}}"...

  1. vuejs focus input on load
  2. vuejs focus input
  3. vuejs focus input modal
  4. vuejs input focus event
  5. vuejs input focus out
  6. vuejs input focus out event
  7. vuejs input focus select all
  8. vuejs focus next input
  9. vuejs set focus input
  10. vuejs auto focus input
  11. vuejs give input focus
  12. vuejs remove focus from input
  13. vuejs if input focus

I'm trying to perform the same encryption operation in Java (using Bouncy Castle) and Node.js, however I receive different results in each language. Below are my attempted implementations - can anyone ...

I'm trying to perform the same encryption operation in Java (using Bouncy Castle) and Node.js, however I receive different results in each language. Below are my attempted implementations - can anyone ...

  1. expecting different results when