Add step to number setting inputbox (#167093)

Fixes #166897
This commit is contained in:
Raymond Zhao 2022-11-23 12:26:54 -08:00 committed by GitHub
parent 63335523e6
commit 4266e06e07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -265,6 +265,14 @@ export class InputBox extends Widget {
}
}
public get step(): string {
return this.input.step;
}
public set step(newValue: string) {
this.input.step = newValue;
}
public get height(): number {
return typeof this.cachedHeight === 'number' ? this.cachedHeight : dom.getTotalHeight(this.element);
}

View file

@ -1758,6 +1758,7 @@ export class SettingNumberRenderer extends AbstractSettingRenderer implements IT
template.onChange = undefined;
template.inputBox.value = dataElement.value;
template.inputBox.step = dataElement.valueType.includes('integer') ? '1' : 'any';
template.inputBox.setAriaLabel(dataElement.setting.key);
template.onChange = value => {
if (!renderValidations(dataElement, template, false)) {