From 951c7af724532fb69f66287d33f795ba1103d4aa Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Tue, 13 Nov 2018 07:48:25 -0800 Subject: [PATCH] Allow text fields next to range inputs be empty (yeah that's horrendous grammar but I'm very tired) (#273) --- src/components/range/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/range/index.tsx b/src/components/range/index.tsx index fabc75c9..0d69511a 100644 --- a/src/components/range/index.tsx +++ b/src/components/range/index.tsx @@ -13,6 +13,8 @@ export default class Range extends Component { @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);