Mathachew / jquery-autotab

A jQuery plugin that provides auto tabbing and filtering on text fields in a form
http://autotab.mathachew.com/
366 stars 98 forks source link

filtering doesn't work on input[type=number] #81

Closed Aratramba closed 9 years ago

Aratramba commented 9 years ago

According to #75 limited support for tel, and several other HTML5 input fields was added. (What does limited support mean?)

Try to type 12,5 in to both input fields here http://jsfiddle.net/8agaog06/. Numberfield doesn't block the comma, textfield does.

<input type="number" id="numberField">
<input type="text" id="textField">
$('#numberField').autotab('number');
$('#textField').autotab('number');

Is there a way to get this to work on number inputs?

Mathachew commented 9 years ago

Limited support indicates basic tabbing functionality. The filtering tool relies on selection functionality that most input fields do not support. You can, however, use the keypress event to check the character codes and return true or false if the typed key is allowed.

Aratramba commented 9 years ago

I see, I'll try to find a way around it, thanks. This isn't going to work anytime soon, according to Hixie. He says it's bad UI design too, but let's pretend we never read that.

Seriously, limiting user input in this way is incredibly bad UI.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24796 https://code.google.com/p/chromium/issues/detail?id=324360 https://github.com/firstopinion/formatter.js/issues/29

Could you maybe post the limited-support-thing on number type somewhere in the documentation?

Aratramba commented 9 years ago

I must add though, that keycode checking might not be a proper way to check for user input, since different keyboard layouts, use different keycodes (especially with keypad keys). So I don't think you can be sure what user input is, just based on the keycode.