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

balOfferNumber is piping invalid input values #19

Open
predrag-arsic opened this issue Nov 23, 2021 · 1 comment
Open

balOfferNumber is piping invalid input values #19

predrag-arsic opened this issue Nov 23, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@predrag-arsic
Copy link
Collaborator

When an invalid string value for offer number, the one that has leading or trailing whitespaces ( " 501234567" or "501234567 " ), is pasted inside the input field which has binded [value] property of the <bal-input> form still considers this string as invalid, as it should because it's invalid to regex matching, but it is properly piped, giving the user right output in the input field (for mentioned examples it is "50/1.234.567"). This gives the user the wrong sense that the data provided are correct, though they are not.

As I've investigated a bit, the problem comes down to using parseInt inside balOfferNumber because this will parse to number regardless of whitespaces. Maybe we should reconsider including the check for the length of the string before doing anything else in this function?

@yannickholzenkamp
Copy link
Member

Hi @predrag-arsic
Is this issue still relevant?
Could you elaborate a little about the actual and desired behaviour?

As far as I understood from your description a number with leading/trailing whitespaces is formatted correctly. Which sounds pretty good to me, as I think a user should be allowed to enter whitespaces there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants