joomla-cms
joomla-cms copied to clipboard
Integer custom field cannot deal with big range of numbers.
Steps to reproduce the issue
Create an "Integer" custom field. In its settings set: First : 10000 Last: 10000000
Now open an article.
Expected result
Load the article.
Actual result
Blank page. The browser hangs as it has to create a big drop-down.
Additional comments
The drop-down solution is not ideal at all.
- The admin/user has to scroll a long list, to find a number.
- It hangs when dealing with big range of numbers (as reported). I faced that many times when i tried to use it for prices.
My suggestion is to replace the drop-down with the input number. That solves the problems i reported and has all the features of the current "Integer" (min, max, step).
Just create a text field with a filter integer.
With such a giant range of values no one is going to want to scroll through a list
Would be cool if we could have different layouts for that field, like dropdown (which we have now) and slider. For such large ranges a slider could be appropriate.
Using such big range obviously will cause a problem somewhere: or server, or on client side. It is expected. For now can use what @brianteeman suggested.
If you just want to ask for new custom field that implement "number" input, then please edit the issue description so it is clear "Feature request", or open a new issue for it.
Thanks.
btw: Joomla already have this field type https://github.com/joomla/joomla-cms/blob/e2170c8a6224ebb6ed754853de0d5e1b97ba1ce9/libraries/src/Form/Field/NumberField.php#L29, but not as custom field.
BTW the number field is very limited in functionality on safari https://caniuse.com/input-number
Guys as a developer i can find the way out. The point of this, is to fix or improve the way it works.
Any range that exceeds 1000 numbers renders it useless and this is a very usual real world scenario. Not to mention that it is almost impossible to use it, after a certain point from the user perspective.
@brianteeman not sure that i get the safari limitations. As far as i can see any version after 2010 seems to support this.
Anyway, if the release leader wants to fix that, i can create a PR.
Please submit PR. It should also fix #27877. Thanks.
I need to get a green light from the release leader.
Sure 🟢 thank you @sakiss 🚀 great if we can also fix the issue @Quy mentioned with your PR. Many thanks for your willingness.
@brianteeman not sure that i get the safari limitations. As far as i can see any version after 2010 seems to support this.
There was an error on the caniuse website that has now been resolved. The issue is onlt with Safari on ios
@sakiss do you still wnat to fix the issue?
@rdeutz yes i will create a PR soon.