numeric-keyboard icon indicating copy to clipboard operation
numeric-keyboard copied to clipboard

[Vue] Unable to fire `press` event from NumericKeyboard

Open aekasitt opened this issue 4 years ago • 2 comments

Here is my setup. I am using vue@^2.6.11

<template>
  <div class='dialog fixed-bottom'>
    <v-numeric-keyboard :layout='PasswordLayout' @press='press' />
  </div>
</template>

<script lang='ts'>
  import Vue from 'vue';
  import { NumericKeyboard, Keys } from 'numeric-keyboard/dist/numeric_keyboard.vue.js';
  const PasswordLayout = <Same as in demo folder>
  export default Vue.extend({
    components: { 'v-numeric-keyboard': NumericKeyboard },
    data() { return { PasswordLayout, password: '' }},
    methods: {
      press(key) {
        console.log(key); // Never Fired.
      }
    }
  });
</script>

aekasitt avatar Oct 05 '20 07:10 aekasitt

Thank you. I can confirm the problem.

Thing is: The Event is fired only on my mobile. Not on the Desktop.

mobsean avatar Nov 16 '20 13:11 mobsean

seems that https://github.com/viclm/numeric-keyboard/blob/a58fb7216fe086696edce13f040005c49ddf11d2/dist/numeric_keyboard.vue.js#L1509

this only listens to touchscreen inputs. click should be added on the eventlisteners

mobsean avatar Nov 17 '20 14:11 mobsean