Answers for "semantic UI react focus on input"

0

semantic UI react focus on input

class InputExampleRefFocus extends Component {
  handleRef = (c) => {
    this.inputRef = c
  }

  focus = () => {
    this.inputRef.focus()
  }

  render() {
    return (
      <div>
        <Button content='focus' onClick={this.focus} />
        <Input ref={this.handleRef} placeholder='Search...' />
      </div>
    )
  }
}
Posted by: Guest on May-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language