kbwood / keypad Goto Github PK
View Code? Open in Web Editor NEWjQuery Keypad Plugin
jQuery Keypad Plugin
Layout with a custom separator and randomize property results in stray buttons at the end of each row
var numericLayout = ['7|8|9|'+$.keypad.CLOSE,
'4|5|6|' + $.keypad.CLEAR,
'1|2|3|' + $.keypad.BACK,
'0'];
$('#defaultKeypad').keypad({
separator: '|',
randomiseNumeric: true,
keypadOnly: false,
layout: numericLayout
});
I file I have to change to make larger buttons?
Thank you
Need dot(.) for entering float numbers
I’m getting a javascript error when using the keypad on an input type=number when using chrome. It doesn’t happen with firefox.
The error occurs when I click on the buttons of the keypad. The numbers do get added though.
It’s happening on the bolded line
if (input.is(':visible')) {
input.focus(); // for further typing
}
if (elem.setSelectionRange) { // Mozilla
if (input.is(':visible')) {
elem.setSelectionRange(pos, pos);
}
}
Here is the chrome error stack trace
Uncaught InvalidStateError: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection. jquery.keypad.modified.js:642
$.JQPlugin.createPlugin.insertValue jquery.keypad.modified.js:642
$.JQPlugin.createPlugin._selectValue jquery.keypad.modified.js:618
(anonymous function) jquery.keypad.modified.js:769
then it gets into the jquery code.
the only modification i have made to the code is swapping the space in numberic layout for a decimal character. the error happens without that change as well. (in case you were wondering why my file name is kquery.keypad.modified.js)
To Repro:
You can see this happen on this demo page:
http://keith-wood.name/keypad.html (Layouts tab)
to see it there:
Interestingly, sometimes it reders it correctly, it seems to depend on if you click something else in between. and it seems like, on the demo page at least, that if you click in the box to open it, then click on the screen, then re-open it, it is the proper width.
The configuration Inline Keypad - randomiseNumeric: true - With multiple targets gives a strange user experience
The Inline Keypad is loaded a 1st time with random numeric key positions
But the numeric key positions are randomised again the first time you click on :
Is there a way to enhance the user experience : to keep the first random numeric key positions for all the user experience in the webpage on the different input fields ?
It is not working with if textarea having CKEditor attached.
if "keypadOnly" config set "false" for any time if we click back btn on keyboard, fild is unfocus and for handle back click we force to focus in field and again click back.
for delete any character we forced this steps.
i fixed this problem by get position in first line at method (_backValue) and decrease 1 from start and end and in end of method set this position for field.
for _clearValue method i focus in field end of method.
I made a inline virtual keypad. On back or clear or close button press, 'insertValue' method is called which doesn't handle these scenarios. 'inserValue' method in js works only for keys with num or char values.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.