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

Strange behavior #170 #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rashidkhalil9182
Copy link

@rashidkhalil9182 rashidkhalil9182 commented May 9, 2023

please verify this issue, if it is fixed please merged this into main and publish. Need this on urgent basis.

@@ -86,7 +86,7 @@ export class InputService {
let {allowNegative, decimal, precision, prefix, suffix, thousands, min, max, inputMode} = this.options;

rawValue = isNumber ? new Number(rawValue).toFixed(precision) : rawValue;
let onlyNumbers = rawValue.replace(this.ONLY_NUMBERS_REGEX, "");
let onlyNumbers = rawValue.replace(suffix,"").replace(this.ONLY_NUMBERS_REGEX, "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that suffix can be anything and it cannot be simply removed from any position of rawValue. It would be better to check that the string ends with suffix and remove suffix.length characters from the end of rawValue.
I think you can similarly remove prefix.

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

Successfully merging this pull request may close these issues.

2 participants