Commit c93e64ba authored by Solveig Hergot Langås's avatar Solveig Hergot Langås
Browse files

#14 Keyboard dismissed after search pressed

parent acfee6e7
import React, { Component } from 'react';
import { StyleSheet, Text, View, TextInput, Alert } from 'react-native';
import { Text, View, TextInput, Keyboard, TouchableWithoutFeedback } from 'react-native';
import { Icon } from 'react-native-elements';
import { connect } from 'react-redux'
import { changeSearchword } from '../actions/SearchAction'
......@@ -14,6 +14,7 @@ class SearchBox extends Component {
}
search = () => {
Keyboard.dismiss()
if (this.state.searchWord.length === 0){ //search blank, show all places
word = "all"
} else {
......@@ -48,7 +49,7 @@ class SearchBox extends Component {
return(
<View style = {{flexDirection: "row", margin: 20}}>
<TextInput style = {inputfield} autoCorrect = {false} onKeyPress = {(e) => this.handleSearchWord(e)} onSubmitEditing = {() => this.search()} />
<Icon name = "search" onPress = {() => this.search()}/>
<TouchableWithoutFeedback><Icon name = "search" onPress = {() => this.search()}/></TouchableWithoutFeedback>
<Text> {this.props.word} </Text>
</View>
);
......
......@@ -25,7 +25,7 @@ class HomePage extends Component{
<Text style={{fontSize: 28, textAlign: "center", padding: 8}}>Welcome to Dream Destinations</Text>
<Text style={{fontSize: 20, textAlign: "center", padding: 8}}>Click here to see a wordcloud showing the most popular locations</Text>
<Text style={{fontSize: 16, textAlign: "center", padding: 8}}>Below you see the five most popular places</Text>
<Card/>
<Card />
</View>
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment