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

POS: Bug Fix - Leading zero in product price #2245

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

shubhamkmr04
Copy link
Contributor

@myxmaster
Copy link
Contributor

That fixes it for most cases, but I can still manually add a leading 0 and Zeus will save it for the product:
grafik

@shubhamkmr04
Copy link
Contributor Author

@myxmaster fixed. lemme know if you can still recreate it

@myxmaster
Copy link
Contributor

You are now blocking leading zeros completely, which means you cannot enter an amount like 0.05 ₿.

The check for leading zeros needs to be done after user clicks button "Save product" and in case they exist, they get deleted. Other checks for invalid chars (anything which is not a number or decimal separator) totally make sense while entering. Right the button "Save product" is disabled, which is not optimal.

@shubhamkmr04 shubhamkmr04 force-pushed the shubham/pos-price-leading-zero branch from a3f955b to 954e075 Compare June 20, 2024 17:08
@myxmaster
Copy link
Contributor

Ok it does work now. But I personally find it a bit irritating when the input is pre-filled with a "0" (not as placeholder, but really the value for the text input).

Btw, I just checked and noticed we have similar issues for amount inputs at other places. For all those I would prefer the following solution:

  • Block entering of invalid chars (anything but numbers and decimal separators should be ignored for amount inputs)
  • Remove invalid chars if pasted (e.g. somebody is pasting "12 304 sats", it should result to "12304")
  • Allow leading zeros but remove them internally when whatever process is continued (product saved, invoice created etc.)

@kaloudis kaloudis mentioned this pull request Jun 20, 2024
29 tasks
@kaloudis
Copy link
Contributor

I personally find it a bit irritating when the input is pre-filled with a "0" (not as placeholder, but really the value for the text input).

Created a separate PR #2258 to address these issues

@kaloudis kaloudis merged commit a5972ea into ZeusLN:master Jun 25, 2024
3 checks passed
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.

3 participants