diff --git a/src/components/views/elements/PowerSelector.tsx b/src/components/views/elements/PowerSelector.tsx index f6e24f2bbb40..4b114863da98 100644 --- a/src/components/views/elements/PowerSelector.tsx +++ b/src/components/views/elements/PowerSelector.tsx @@ -33,7 +33,7 @@ interface IProps { // should the user be able to change the value? false by default. disabled?: boolean; - onChange?: (value: string, powerLevelKey: string) => void; + onChange?: (value: string | number, powerLevelKey: string) => void; // Optional key to pass as the second argument to `onChange` powerLevelKey?: string; @@ -112,7 +112,7 @@ export default class PowerSelector extends React.Component { this.setState({ custom: true }); } else { this.props.onChange(event.target.value, this.props.powerLevelKey); - this.setState({ selectValue: parseInt(event.target.value) }); + this.setState({ selectValue: event.target.value }); } }; @@ -124,7 +124,7 @@ export default class PowerSelector extends React.Component { event.preventDefault(); event.stopPropagation(); - this.props.onChange(String(this.state.customValue), this.props.powerLevelKey); + this.props.onChange(this.state.customValue, this.props.powerLevelKey); }; private onCustomKeyDown = (event: React.KeyboardEvent): void => {