Skip to content

improve searchTextBox UX #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class NoteList extends React.Component {

getNotes () {
let { data, params, location } = this.props
let { router } = this.context

if (location.pathname.match(/\/home/)) {
return data.noteMap.map((note) => note)
Expand All @@ -214,7 +215,11 @@ class NoteList extends React.Component {
}

if (location.pathname.match(/\/searched/)) {
return searchFromNotes(this.props.data, document.getElementsByClassName('searchInput')[0].value)
const searchInputText = document.getElementsByClassName('searchInput')[0].value
if (searchInputText === '') {
router.push('/home')
}
return searchFromNotes(this.props.data, searchInputText)
}

let storageKey = params.storageKey
Expand Down