ecamp3 icon indicating copy to clipboard operation
ecamp3 copied to clipboard

Fix parsing behaviour of number inputs

Open carlobeltrame opened this issue 2 years ago • 1 comments

Problem 1: When entering a float number like 1.5, then pressing backspace, the period is deleted along with the digit 5 (and similar issues due to parsing before blur).

https://github.com/ecamp/ecamp3/assets/7566995/004059fb-c8d4-4f07-b987-f2f7a3efbddc

Problem 2: When entering an invalid number like 1,5 (with a comma instead of a period), the number parser gives up and sends a string instead of a number to the API. This causes a PHP error (before validation rules have a chance to jump in), and the API returns an untranslated error.

https://github.com/ecamp/ecamp3/assets/7566995/a8cfb6d3-18a0-4315-bdfa-6bb8af143472

Both may or may not be fixed with the input field refactoring in #3912

carlobeltrame avatar Oct 21 '23 14:10 carlobeltrame

I am aware of both these issues and will try to fix them in #3912 so please don't start working on this issue.

DeNic0la avatar Oct 21 '23 18:10 DeNic0la