forked from external-repos/squoosh
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:
@@ -13,6 +13,8 @@ export default class Range extends Component<Props, State> {
|
|||||||
@bind
|
@bind
|
||||||
private onTextInput(event: Event) {
|
private onTextInput(event: Event) {
|
||||||
const input = event.target as HTMLInputElement;
|
const input = event.target as HTMLInputElement;
|
||||||
|
const value = input.value.trim();
|
||||||
|
if (!value) return;
|
||||||
this.rangeWc!.value = input.value;
|
this.rangeWc!.value = input.value;
|
||||||
const { onInput } = this.props;
|
const { onInput } = this.props;
|
||||||
if (onInput) onInput(event);
|
if (onInput) onInput(event);
|
||||||
|
|||||||
Reference in New Issue
Block a user