diff doc/upgrading.txt @ 8286:6445e63bb423

feat(web) - Use native number type input for Number() and Integer(). When editing hyperdb.Number() or hyperdb.Integer() properties, use a native number input. For Number you can enter digits, +/-, . and e/E for exponent (1E2 = 100). For integer we have the same keys as number, but also add step=1 to the input. This stops submitting 23.5 suggesting 23 or 24. It does allow 2E4 to be submitted that is rejected with an error from the backend. However if the spinner is used with 2E4 it is turned into 20000, a pure integer and incremented/decremented by the spinner. The upgrade happens automatically. Directions on going back to text input provided. User guide updated to describe addition of spinner. Tests added.
author John Rouillard <rouilj@ieee.org>
date Sat, 18 Jan 2025 14:54:31 -0500
parents 2bf0c4e7795e
children b99e76e76496
line wrap: on
line diff
--- a/doc/upgrading.txt	Sat Jan 18 12:23:23 2025 -0500
+++ b/doc/upgrading.txt	Sat Jan 18 14:54:31 2025 -0500
@@ -224,8 +224,8 @@
 
 .. _defusedxml: https://pypi.org/project/defusedxml/
 
-Use native date inputs (optional)
----------------------------------
+Enable use of native date inputs (optional)
+-------------------------------------------
 
 Roundup now uses native date or datetime-local inputs for Date()
 properties. These inputs take the place of the text input and
@@ -308,6 +308,8 @@
 will generate the input as in Roundup 2.4 or earlier without a
 popcal link.
 
+.. _revert_input_to_text:
+
 If you are using a path expression like::
 
   tal:content="context/duedate/field"
@@ -366,6 +368,22 @@
 keyboard. Tablet/touch support is mixed. Chrome supports
 double-tap to activate text mode input. Firefox does not.
 
+Revert native number inputs for Number() and Integer() (optional)
+-----------------------------------------------------------------
+
+Roundup's field() method for properties of type Number() or
+Integer() now use a native browser number input.
+
+You can use the old style text inputs by calling the field
+method with ``type="text"``. You can :ref:`follow the example
+for setting the text argument on a Date()
+property. <revert_input_to_text>` for details.
+
+Note that the Integer() type also uses ``step="1"`` by default to
+add a stepper control and try to constrain the input to
+integers. This can be overridden by passing a new step
+(e.g. ``step="50"``) to the field() method.
+
 Change in REST response for invalid CORS requests (info)
 --------------------------------------------------------
 

Roundup Issue Tracker: http://roundup-tracker.org/