icebob / vue-touch-keyboard

Virtual keyboard component for Vue.js 2.x. Designed to Raspberry Pi Touch Display
MIT License
300 stars 116 forks source link

@touchstart event ? #29

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi, I'm using your (very helpful) plugin with a true kiosk machine that has no real keyboard input. It works really well, however we noticed that some elderly customers long-press on screen and as the whole plugin is based on click events, they feel the screen as unresponsive (they should leave the finger to see the input changed). It's a subtle feeling but it's there, and I wonder if a touchstart event could be better suited for this kind of interaction.

Your thoughts ?

icebob commented 6 years ago

Hi, I'm using it with different touch displays and the problem is that some touch driver generates only click event. So the better way is to handle both events and avoid duplicated events. Because from touch events the browser generates click event too.

ghost commented 6 years ago

yeah, I see your point, will you accept a PR with this kind of change ?

https://codesandbox.io/s/lxq814kp0l

icebob commented 6 years ago

Yes, of course.

By the way, what is in the codesandbox link?

ghost commented 6 years ago

Sorry I should have been more explicit:

@touchstart="method"
@click="method"

...

method(e) {
  e.preventDefault();  // prevents triggering click event when touchstart exists
}
icebob commented 6 years ago

OK.

andreasrein commented 5 years ago

Any updates on this issue?