Fix behavior of map tint due to search bar changes
The map tint is now deactivated in response to search bar behavior when pressing enter, selecting one of the search results, or tapping on the map (pin or background). Addresses issue #410.
Related Issues: #410, #428 Related PRs: #228
Note to reviewer: Most of the changes in src/components/SelectedTap/SelectedTap.js are just cosmetic, e.g. due to prettier formatting.
Hi, the merge conflicts with develop should be addressed now. And, below are a few additional notes for the reviewer.
- One of the trickier edge cases occurred as follows: if a user clicks the search bar, then clicks on a tap, and then clicks on the search bar, the last click will cause the search bar to become focused (and so the map tint is activated). This seems unnatural however, I think, since the user may have just wanted to go back to the map to look around, not necessarily activate search, thus requiring an additional user click to turn the tint off. Hence, to prevent this issue, an additional piece of redux state was introduced to track this edge case:
tapInfoOpenedWhileSearchOpen - After reviewing, I think the
onBlurevent works well here, e.g. it probably doesn't make sense to switch to usinguseOnClickOutsidehere. - Also, made the switch to using
createAction.
cc: @gcardonag, @tomporvaz
Ah yes, there were quite a few possibilities to account for, and I was trying to express things in a concise way so as not to give a larger but more confusing amount of detail. Apologies if it could have been clearer. Thanks for reviewing and the merge!