Skip to content

Commit

Permalink
add blur method issue react-native-elements#77
Browse files Browse the repository at this point in the history
  • Loading branch information
dabit3 committed Nov 7, 2016
1 parent 68e5ef3 commit 0970161
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ import { SearchBar } from 'react-native-elements'
| round | false | boolean | change TextInput styling to rounded corners |
| containerRef | none | ref | ref for TextInput conainer |
| textInputRef | none | ref | ref for TextInput |
| focus | none | function | call focus on the textinput(optional), eg `this.refs.someInputRef.focus()` |


## Cross Platform Tab Bar
Expand Down
4 changes: 4 additions & 0 deletions src/form/FormInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class FormInput extends Component {
const ref = this.props.textInputRef
this.refs[ref].focus()
}
blur() {
const ref = this.props.textInputRef
this.refs[ref].blur()
}
render () {
const {
containerStyle,
Expand Down
4 changes: 4 additions & 0 deletions src/input/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import colors from '../config/colors'
import normalize from '../helpers/normalizeText'

class Search extends Component {
focus() {
const ref = this.props.textInputRef
this.refs[ref].focus()
}
render () {
const {
containerStyle,
Expand Down

0 comments on commit 0970161

Please sign in to comment.