Every line of 'react clear input after button click' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
48 function handleClickClear() { 49 onChange(''); 50 $input.current.focus(); 51 }
34 onInputClear() { 35 this.setState(() => ({ 36 expanded: false, 37 value: '', 38 })); 39 }
30 _onClearClick () { 31 this.setVal('') 32 }
54 handleClear(e) { 55 e.stopPropagation(); 56 this.props.onClear && this.props.onClear(); 57 this.handleChange(''); 58 }
41 clearInput() { 42 ReactDOM.findDOMNode(this.refs.input).value = ''; 43 }
72 _onClear () { 73 const node = ReactDOM.findDOMNode(this) 74 node.value = '' 75 }
297 value: function onClickClear () { 298 this.setState(function (_ref2) { 299 var count = _ref2.count, 300 countTotal = _ref2.countTotal 301 302 return { 303 isClicked: false, 304 countTotal: countTotal - count, 305 count: 0 306 } 307 }) 308 }
54 clear() { 55 this.setState({ value: '' }); 56 57 // trigger onchange event on input 58 this.inputNode.value = ''; 59 this.onChange({ currentTarget: this.inputNode }); 60 this.inputNode.focus(); 61 }
202 onClickClearButton () { 203 this.props.onChange(null, true, true) 204 }
603 clearValue() { 604 this.setState({ value: undefined }); 605 }