You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
amended the del: function() to force the cursor position back to 0 if it goes to anything less than.
del: function() {
var a = jsKeyboard.currentElement.val(),
pos = jsKeyboard.currentElementCursorPosition,
output = [a.slice(0, pos-1), a.slice(pos)].join('');
jsKeyboard.currentElement.val(output);
//below if statement added to reset cursor position
if (pos <= 0) {
pos = "0";
//set cursor position set at top of this script if it goes below 0 the set it back to 0
jsKeyboard.setcurrentElementCursorPosition;
jsKeyboard.updateCursor();
} else {
jsKeyboard.currentElementCursorPosition--; //-1 cursor
jsKeyboard.updateCursor();
}},
cursor position always gets reset to 0 now when it goes to negative numbers.
Hope this helps
Thanks
The text was updated successfully, but these errors were encountered:
When all text has been deleted the cursor should stop at position 0, but it allows it to go into negative numbers.
to fix this i edited jsKeyboard.js
added below line 26
jsKeyboard.setcurrentElementCursorPosition = $(this).setCursorPosition(0);
amended the del: function() to force the cursor position back to 0 if it goes to anything less than.
del: function() {
var a = jsKeyboard.currentElement.val(),
pos = jsKeyboard.currentElementCursorPosition,
output = [a.slice(0, pos-1), a.slice(pos)].join('');
jsKeyboard.currentElement.val(output);
//below if statement added to reset cursor position
if (pos <= 0) {
pos = "0";
//set cursor position set at top of this script if it goes below 0 the set it back to 0
jsKeyboard.setcurrentElementCursorPosition;
jsKeyboard.updateCursor();
} else {
jsKeyboard.currentElementCursorPosition--; //-1 cursor
jsKeyboard.updateCursor();
}},
cursor position always gets reset to 0 now when it goes to negative numbers.
Hope this helps
Thanks
The text was updated successfully, but these errors were encountered: