Skip to content

Commit 5a11de0

Browse files
committed
unselect all when focusing on search input
1 parent 42d542f commit 5a11de0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

web/src/components/Header/HeaderRightPanel.component.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export default function HeaderRightPanel({
8888
commentList,
8989
openExpandedView,
9090
animatePanAndZoom,
91+
unselectAll,
9192
projectId,
9293
}) {
9394
const ref = useRef()
@@ -156,6 +157,9 @@ export default function HeaderRightPanel({
156157
classNames="search-input-wrapper"
157158
>
158159
<input
160+
onFocus={() => {
161+
unselectAll()
162+
}}
159163
type="text"
160164
onChange={(e) => setFilterText(e.target.value.toLowerCase())}
161165
value={filterText}

web/src/components/Header/HeaderRightPanel.connector.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { RootState } from '../../redux/reducer'
33
import { openExpandedView } from '../../redux/ephemeral/expanded-view/actions'
44
import { animatePanAndZoom } from '../../redux/ephemeral/viewport/actions'
55
import HeaderRightPanel from './HeaderRightPanel.component'
6+
import { unselectAll } from '../../redux/ephemeral/selection/actions'
67

78
function mapStateToProps(state: RootState) {
89
const projectId = state.ui.activeProject
@@ -19,6 +20,9 @@ function mapStateToProps(state: RootState) {
1920

2021
function mapDispatchToProps(dispatch) {
2122
return {
23+
unselectAll: () => {
24+
dispatch(unselectAll())
25+
},
2226
animatePanAndZoom: (address) => {
2327
return dispatch(animatePanAndZoom(address))
2428
},

0 commit comments

Comments
 (0)