joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Integer custom field cannot deal with big range of numbers.

Open sakiss opened this issue 1 year ago • 11 comments
trafficstars

Steps to reproduce the issue

Create an "Integer" custom field. In its settings set: First : 10000 Last: 10000000

Articles-Edit-Field-joomla4-Administration

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.

  1. The admin/user has to scroll a long list, to find a number.
  2. 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).

sakiss avatar Dec 29 '23 12:12 sakiss

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

brianteeman avatar Dec 29 '23 16:12 brianteeman

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.

richard67 avatar Dec 30 '23 08:12 richard67

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.

Fedik avatar Dec 30 '23 09:12 Fedik

BTW the number field is very limited in functionality on safari https://caniuse.com/input-number

brianteeman avatar Dec 30 '23 10:12 brianteeman

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.

sakiss avatar Dec 30 '23 18:12 sakiss

Please submit PR. It should also fix #27877. Thanks.

Quy avatar Jan 10 '24 03:01 Quy

I need to get a green light from the release leader.

sakiss avatar Jan 12 '24 13:01 sakiss

Sure 🟢 thank you @sakiss 🚀 great if we can also fix the issue @Quy mentioned with your PR. Many thanks for your willingness.

LadySolveig avatar Jan 12 '24 16:01 LadySolveig

@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

brianteeman avatar Jan 16 '24 09:01 brianteeman

@sakiss do you still wnat to fix the issue?

rdeutz avatar Apr 27 '24 11:04 rdeutz

@rdeutz yes i will create a PR soon.

sakiss avatar Apr 27 '24 13:04 sakiss