Set step size for numeric input controls.

This commit is contained in:
Robin E.R. Davies
2026-04-20 13:21:28 -04:00
parent 1d05500784
commit 5c492ea848
3 changed files with 13 additions and 1 deletions
-1
View File
@@ -11,7 +11,6 @@
- Channel Routing: configure audio channels as Aux or re-amp channels.
## PiPedal 1.5.99 Beta
### Bug Fixes
+1
View File
@@ -163,6 +163,7 @@ export const NumericInput =
render() {
//const classes = withStyles.getClasses(this.props);
return (<Input style={{ width: 65 }}
inputProps={{
+12
View File
@@ -888,6 +888,14 @@ const PluginControl =
currentValue: number = 0;
uiControl?: UiControl = undefined;
private defaultStep(min: number, max: number): number {
let range = Math.abs(max - min);
if (range <= 1) return 0.01;
if (range <= 10) return 0.1;
if (range <= 100) return 1;
if (range <= 1000) return 10;
return 100;
}
render() {
const classes = withStyles.getClasses(this.props);
let t = this.props.uiControl;
@@ -1107,6 +1115,10 @@ const PluginControl =
min: this.props.uiControl?.min_value,
max: this.props.uiControl?.max_value,
step: this.defaultStep(
this.props.uiControl?.min_value ?? 0,
this.props.uiControl?.max_value ?? 100
)
}}
sx={{