input: allow using a number in numeric to specify stepping value for mousewheel interaction

This commit is contained in:
jean-emmanuel 2024-01-17 16:16:09 +01:00
parent 9181c2a3aa
commit a04c658bb5
2 changed files with 7 additions and 1 deletions

View file

@ -8,6 +8,9 @@
- remote control
- `/EDIT*` commands sent by a custom module are not affected by the server's `read-only` option anymore
- widgets
- input: allow using a number in `numeric` to specify stepping value for mousewheel interaction
## 1.25.6
- bug fixes

View file

@ -20,7 +20,9 @@ class Input extends Canvas {
},
class_specific: {
asYouType: {type: 'boolean', value: false, help: 'Set to `true` to make the input send its value at each keystroke'},
numeric: {type: 'boolean', value: false, help: ['Set to `true` to allow numeric values only and display a numeric keyboard on mobile devices']},
numeric: {type: 'boolean|number', value: false, help: [
'Set to `true` to allow numeric values only and display a numeric keyboard on mobile devices',
'Can be a number to specify the stepping value for mousewheel interaction (only when the input is focused).']},
validation: {type: 'string', value: '', help: [
'Regular expression: if the submitted value doesn\'t match the regular expression, it will be reset to the last valid value.',
'If leading and trailing slashes are omitted, they will be added automatically and the flag will be set to "gm"',
@ -65,6 +67,7 @@ class Input extends Canvas {
this.input.type = 'number'
this.input.pattern = '[0-9\.]*'
this.input.inputMode = 'decimal'
this.input.step = parseFloat(this.getProp('numeric')) || 1
}
if (this.getProp('maxLength') !== '') {