Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
fix: update search box and fix chips not hiding on blur
Browse files Browse the repository at this point in the history
  • Loading branch information
antsgar committed Mar 23, 2021
1 parent 4bed869 commit 4d83d7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -47,7 +47,7 @@
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.16.1",
"react-native-search-bar": "standardnotes/react-native-search-bar#7d2139d",
"react-native-search-box": "standardnotes/react-native-search-box#cc295af7fd8e5e75cbe729ca490babeb9377f60e",
"react-native-search-box": "standardnotes/react-native-search-box#c0de5bab18cb418fef75ef2c2cd921304142e492",
"react-native-sodium": "standardnotes/react-native-sodium#17b240ea0c2656c89b83cd0168acfbb64f67f0e1",
"react-native-store-review": "^0.1.5",
"react-native-tab-view": "^2.15.2",
Expand Down
21 changes: 5 additions & 16 deletions src/screens/Notes/NoteList.tsx
Expand Up @@ -168,21 +168,13 @@ export const NoteList = (props: Props) => {
};

const onSearchFocus = () => {
if (shouldFocusSearch) {
props.setShouldFocusSearch(false);
} else {
toggleSearchOptions(true);
}
toggleSearchOptions(true);
props.setShouldFocusSearch(false);
};

const onSearchBlur = () => {
if (!shouldFocusSearch && !isFocusingSearch) {
toggleSearchOptions(false);
}

if (isFocusingSearch) {
setIsFocusingSearch(false);
}
toggleSearchOptions(false);
setIsFocusingSearch(false);
};

const renderItem: ListRenderItem<SNNote> | null | undefined = ({ item }) => {
Expand Down Expand Up @@ -239,10 +231,7 @@ export const NoteList = (props: Props) => {
<AndroidSearchBar
ref={androidSearchBarInputRef}
onChangeText={onChangeSearchText}
onCancel={() => {
props.onSearchCancel();
onSearchBlur();
}}
onCancel={onSearchBlur}
onDelete={props.onSearchCancel}
onFocus={onSearchFocus}
onBlur={onSearchBlur}
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Expand Up @@ -6897,9 +6897,9 @@ react-native-search-bar@standardnotes/react-native-search-bar#7d2139d:
dependencies:
prop-types "^15.5.10"

react-native-search-box@standardnotes/react-native-search-box#cc295af7fd8e5e75cbe729ca490babeb9377f60e:
react-native-search-box@standardnotes/react-native-search-box#c0de5bab18cb418fef75ef2c2cd921304142e492:
version "0.0.19"
resolved "https://codeload.github.com/standardnotes/react-native-search-box/tar.gz/cc295af7fd8e5e75cbe729ca490babeb9377f60e"
resolved "https://codeload.github.com/standardnotes/react-native-search-box/tar.gz/c0de5bab18cb418fef75ef2c2cd921304142e492"
dependencies:
prop-types "^15.5.10"

Expand Down

0 comments on commit 4d83d7c

Please sign in to comment.