Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Max input length #312

Merged
merged 4 commits into from
Apr 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/view/components/toolbar/InputSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class InputSlider extends React.Component<ISliderProps, any, any> {
value={this.props.value}
onInput={this.handleOnChange}
defaultValue={this.props.minValue.toLocaleString()}
pattern="^-?[0-9]{0,4}$"
pattern={`^-?[0-9]{0,${
this.props.maxValue.toString().length
}}$`}
onKeyUp={this.handleOnChange}
aria-label={`${this.props.type} sensor input ${this.props.axisLabel}`}
/>
Expand Down