Keycode is always zero in Chrome for Android

后端 未结 10 2074
栀梦
栀梦 2020-12-05 13:17

I need to detect the keycode for a custom search box on my website, but the keycode always returns as zero on Chrome for Android (except for backspace, which returns 8). Has

10条回答
  •  眼角桃花
    2020-12-05 13:53

    change the type of the input to tel :

    this will let you log the keyCode but it doesnt log the backspace, and it might force the keyboard on mobile to only numbers.

提交回复
热议问题