Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not allowing to change existing number to 0 #1381

Closed
GaikwadVikas opened this issue Sep 8, 2016 · 7 comments
Closed

Not allowing to change existing number to 0 #1381

GaikwadVikas opened this issue Sep 8, 2016 · 7 comments
Assignees
Labels

Comments

@GaikwadVikas
Copy link

@RobinHerbots ,
Please, visit your demosilte
Now enter any amount in Currency input. After that select that amount and press 0. It will not allow, But it is working for other than 0.
I want to change entered amount into 0.

I extended Aliases as below:

Inputmask.extendAliases({
currency: {
prefix: "",
groupSeparator: "",
alias: "numeric",
placeholder: "0",
autoGroup: false,
digits: 4,
digitsOptional: true,
positionCaretOnClick: "none",
clearMaskOnLostFocus: false,
removeMaskOnSubmit: true,
autoUnmask: true
}
});

@GaikwadVikas
Copy link
Author

GaikwadVikas commented Sep 8, 2016

One more thing, If value is zero then we get blank while posting data. If I forcefully enter zero value then it should work. Rather it sholud always return zero insted of blank. Because, I am using numeric masking.

Zero key should work like decimal key if all text is selected.

@GaikwadVikas
Copy link
Author

@RobinHerbots , If you have in work around to fix this issue please tell me. I am stuck due to this issue.

Thanks

@RobinHerbots
Copy link
Owner

@GaikwadVikas ,

I will fix this, when time allows.

@BLSully
Copy link

BLSully commented Sep 13, 2016

+1 to this issue. This is the only pain point I've found so far using this plugin for doing currency input masks. For the application I'm working on, zeroing out an input is a common need.

Current workaround is "highlight and hit delete". This return 0 when the unmask() is called with the default placeholder of "0" and "unmaskAsNumber" set to true

@GaikwadVikas
Copy link
Author

@BLSully , thanks buddy.

@RobinHerbots RobinHerbots added this to the 3.4 milestone Sep 14, 2016
@RobinHerbots RobinHerbots self-assigned this Sep 14, 2016
@ToddHoff
Copy link

Hi, does this issue have a fix or a workaround? I'm still experiencing it as a problem. Tab into a currency field and you can't enter a 0, which is a common task.

@Zoopme
Copy link

Zoopme commented Aug 20, 2021

Hi, does this issue have a fix or a workaround? I'm still experiencing it as a problem. Tab into a currency field and you can't enter a 0, which is a common task.

Same here. using $field.val(0); and getting an empty field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants