mirror of
https://github.com/zhigang1992/uber-cities.git
synced 2026-04-24 04:55:33 +08:00
Upper case first city letters (#64)
* Upper case first city letters * Fixed ident * Update index.js
This commit is contained in:
committed by
Sara Vieira
parent
2df31d0b7d
commit
8ca947c5fa
@@ -10,7 +10,15 @@ export default class Home extends Component {
|
||||
value: '',
|
||||
}
|
||||
|
||||
handleChange = e => this.setState({ value: e.target.value })
|
||||
handleChange = e => {
|
||||
this.setState({
|
||||
value: e.target.value
|
||||
.toLowerCase()
|
||||
.split(' ')
|
||||
.map((s) => s.charAt(0).toUpperCase() + s.substring(1))
|
||||
.join(' ')
|
||||
})
|
||||
}
|
||||
|
||||
handleSubmit = e => {
|
||||
const { value } = this.state
|
||||
|
||||
Reference in New Issue
Block a user