Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

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

Jake Archibald951c7af72453
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<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);