Skip to content

Commit

Permalink
fix shift+enter to select anntoation into bulk edit
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Jun 14, 2024
1 parent 7379707 commit 76ef1c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/annotations/components/AnnotationEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1255,17 +1255,16 @@ export default class AnnotationEditable extends React.Component<Props, State> {
onClick={(
event: React.MouseEvent<HTMLInputElement>,
) => {
event.preventDefault()
event.stopPropagation()
if (
event.nativeEvent.shiftKey &&
this.props.shiftSelectItem
) {
console.log('shift select item')
this.props.shiftSelectItem()
event.preventDefault()
event.stopPropagation()
} else {
this.props.bulkSelectAnnotation()
event.preventDefault()
event.stopPropagation()
}
}}
size={16}
Expand All @@ -1287,7 +1286,7 @@ export default class AnnotationEditable extends React.Component<Props, State> {
}

handleMouseLeave = () => {
if (!this.props.focusLockUntilMouseStart) {
if (!this.props.focusLockUntilMouseStart && !this.isAnyModalOpen()) {
this.setState({ hoverCard: false })
if (this.hoverTimeout) {
clearTimeout(this.hoverTimeout)
Expand Down
11 changes: 10 additions & 1 deletion src/dashboard-refactor/search-results/components/page-result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ export default class PageResultView extends PureComponent<Props> {
this.getMatches(this.props.text)
}

private isAnyModalOpen() {
const isOpen =
this.props.listPickerShowStatus != 'hide' ||
this.props.isCopyPasterShown
return isOpen
}

updateMatchingTextContainerHeight = async () => {
await sleepPromise(50)

Expand Down Expand Up @@ -333,6 +340,7 @@ export default class PageResultView extends PureComponent<Props> {
}}
strategy={'fixed'}
getPortalRoot={this.props.getRootElement}
instaClose
>
{this.props.renderSpacePicker()}
</PopoutBox>
Expand All @@ -352,6 +360,7 @@ export default class PageResultView extends PureComponent<Props> {
}}
strategy={'fixed'}
getPortalRoot={this.props.getRootElement}
instaClose
>
{this.props.renderSpacePicker()}
</PopoutBox>
Expand Down Expand Up @@ -948,7 +957,7 @@ export default class PageResultView extends PureComponent<Props> {
}

onUnhover = (event) => {
if (!this.props.focusLockUntilMouseStart) {
if (!this.props.focusLockUntilMouseStart && !this.isAnyModalOpen()) {
this.setState({ hoveredMouse: false })
if (this.hoverTimeout) {
clearTimeout(this.hoverTimeout)
Expand Down

0 comments on commit 76ef1c2

Please sign in to comment.