Skip to content

Commit

Permalink
make annotation shift enter selectable, blur search when new result i…
Browse files Browse the repository at this point in the history
…n focus
  • Loading branch information
blackforestboi committed Jun 14, 2024
1 parent 656bedb commit 7379707
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/annotations/components/AnnotationEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,7 @@ export default class AnnotationEditable extends React.Component<Props, State> {
case 'Enter':
if (!this.props.isEditing) {
if (event.shiftKey && this.props.shiftSelectItem) {
this.props.shiftSelectItem()
event.preventDefault()
event.stopPropagation()
} else {
// this.props.shiftSelectItem()
this.props.bulkSelectAnnotation()
event.preventDefault()
event.stopPropagation()
Expand Down Expand Up @@ -1370,7 +1367,9 @@ export default class AnnotationEditable extends React.Component<Props, State> {
</>
)}
{bulkSelectAnnotation &&
(this.props.isBulkSelected || this.state.hoverCard) &&
(this.props.isBulkSelected ||
this.state.hoverCard ||
this.props.isInFocus) &&
this.props.currentUserId === this.props.creatorId &&
bulkSelectAnnotation &&
this.renderBulkSelectBtn()}
Expand Down
4 changes: 4 additions & 0 deletions src/dashboard-refactor/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,10 @@ export class DashboardLogic extends UILogic<State, Events> {
})
}
if (event.item?.id != null) {
const searchBarElement = document.getElementById('search-bar')
if (searchBarElement) {
searchBarElement.blur()
}
const itemPos = event.item?.id?.split('-')[0]
if (parseFloat(itemPos) === currentFocusElementIndex) {
return
Expand Down

0 comments on commit 7379707

Please sign in to comment.