Allow text fields next to range inputs be empty (yeah that's horrendous grammar but I'm very tired) (#273)

This commit is contained in:
Jake Archibald
2018-11-13 07:48:25 -08:00
committed by GitHub
parent 53b46f879f
commit 951c7af724

View File

@@ -13,6 +13,8 @@ export default class Range extends Component<Props, State> {
@bind
private onTextInput(event: Event) {
const input = event.target as HTMLInputElement;
const value = input.value.trim();
if (!value) return;
this.rangeWc!.value = input.value;
const { onInput } = this.props;
if (onInput) onInput(event);