jquery-maskmoney
jquery-maskmoney copied to clipboard
Ignores click position
This seems to have been introduced recently, not too sure if it was since 3.0 or later.
Basically, when I click with my mouse to put the cursor in the field, it forces me to be at the end of the decimal. Previously, I could click anywhere in the value and the cursor would stay there so I could edit a specific part of the value instead of the entire value.
For example: I have an input with a value of $100.50
. If I were to click between the 00
of the 100 I could delete just a single 0 to get $10.50
. Now, no matter where I click, it puts the cursor at the end of the .50
so I have to delete and then retype the entire value... This is causing problem for my program as everyone was use to being able to click where they wanted to change and make a small adjustment and now they have to delete and retype the entire value. It slows down workflow and takes people longer to fill out forms than it previously did.
Also, double-click no longer lets you select the entire field to delete but ctrl+a does still work.
This could be a bug or a feature depending on your point of view. I'd suggest the former and think that this ability should be a setting as some may like this functionality.
I started using maskmoney just like 30 mins ago and i need to agree. Thanks to arrow keys you can move where you want. 'Home' and 'End' keys lacks of implementation.
It seems to be one more problem with cursor position on clicking. Using jquery``focus()on input with CSS
text-align: rightmakes it go on left (wrong) instead normal right. Using
focus().click()solves to case. I know its rare case, but it shows that jquery
.focus()` ommits repositioning the cursor.
Line 373 is where the cursor position changes on click. Commenting out that line works for me.
function clickEvent() {
var input = $input.get(0),
length;
if (input.setSelectionRange) {
length = $input.val().length;
//input.setSelectionRange(length, length);
} else {
$input.val($input.val());
}
}
Yup, also experiencing issues with selection moving at the end of input and not being able to select whole text with double-click.
I'm having the same issue. Can't use maskmoney without a fix...
I think this issues can be close now. There is a setting name «bringCaretAtEndOnFocus». By default this setting is true. You just need to put it to false and it solve your problem.
There is a setting name «bringCaretAtEndOnFocus».
This needs to be documented.