BUG in Range Input?

Radiator
Shopify Expert
49 0 12

Hi!

Found some odd behavior. Not sure if a Bug in Theme Customizer or not.

When using the Range Input in your schema, it doesn't allow for negative numbers.

When sliding to a negative number, you get an error: Setting 'xxxx' must be a valid number.

The following, for example does not work as soon as you hit a negative number:

...
{
 "type": "range",
 "id": "translate_X",
 "label": "Content X Offset",
 "min": -100,
 "max": 100,
 "step": 10,
 "unit": "px",
 "default": 0
}
...

In the docs for range slider it has no mention of negative numbers, and specifies 'The numbers can be integers or floats.'

https://help.shopify.com/themes/development/theme-editor/settings-schema#range

Just passing this along, if its intended behavior or not.

Best,

Justin

 

@radiatorstudios
Reply 1 (1)
Mircea_Piturca
Shopify Partner
1545 44 343

Looks like a bug.

You can specify a negative number for min and max:  "The default, min, max step values must be numbers. The numbers can be integers or floats". Negative numbers will validate but you can't use them.

However in the editor, going below 0 will throw an error.

Finally—Add variant descriptions to your products