Skip to content

Commit

Permalink
[default-layout] Prevent unnecessary rerenders of Search component (#394
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bjoerge authored Nov 29, 2017
1 parent fff20f1 commit 300e583
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@sanity/default-layout/src/components/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ export default enhanceClickOutside(class Search extends React.Component {
}

handleClickOutside = el => {
this.close()
if (this.state.isOpen) {
this.close()
}
}

handleHitClick = el => {
Expand Down

0 comments on commit 300e583

Please sign in to comment.