pegasus
Well-known member
- Affected version
- 2.0.12
In XenForo 2.x, the "step" parameter for spinboxes behaves differently from XF 1.x.
In XenForo 1.x, the "step" parameter allowed to +/- to skip ahead/back in pre-defined increments. If the user desired a custom value outside of those increments, it was permitted. The DataWriter never validated that a numeric option value was consistent with "step". The input element was type=text.
In XenForo 2.x, the input element used for spinboxes is now type=number. This triggers browser validation of the field, which verifies that the input value is consistent with the element's "step" attribute. However, the Option entity does not validate that numeric option values are consistent with "step", leading me to believe that the value should not be validated in this way.
In XenForo 1.x, many add-ons used the spinbox step parameter solely as a convenience so the user could jump increments quickly. If an add-on wanted to validate that the number fulfilled certain requirements, it did so using an option handler.
In XenForo 2.x, is this a bug or an intended change in behavior? I did not find any documentation of the change with a quick search. If the change is intended, might I suggest a new format parameter like soft_step or something so that we can achieve the previous behavior if desired?
In XenForo 1.x, the "step" parameter allowed to +/- to skip ahead/back in pre-defined increments. If the user desired a custom value outside of those increments, it was permitted. The DataWriter never validated that a numeric option value was consistent with "step". The input element was type=text.
In XenForo 2.x, the input element used for spinboxes is now type=number. This triggers browser validation of the field, which verifies that the input value is consistent with the element's "step" attribute. However, the Option entity does not validate that numeric option values are consistent with "step", leading me to believe that the value should not be validated in this way.
In XenForo 1.x, many add-ons used the spinbox step parameter solely as a convenience so the user could jump increments quickly. If an add-on wanted to validate that the number fulfilled certain requirements, it did so using an option handler.
In XenForo 2.x, is this a bug or an intended change in behavior? I did not find any documentation of the change with a quick search. If the change is intended, might I suggest a new format parameter like soft_step or something so that we can achieve the previous behavior if desired?