Skip to content

Commit 76ef1c2

Browse files
fix shift+enter to select anntoation into bulk edit
1 parent 7379707 commit 76ef1c2

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/annotations/components/AnnotationEditable.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,17 +1255,16 @@ export default class AnnotationEditable extends React.Component<Props, State> {
12551255
onClick={(
12561256
event: React.MouseEvent<HTMLInputElement>,
12571257
) => {
1258+
event.preventDefault()
1259+
event.stopPropagation()
12581260
if (
12591261
event.nativeEvent.shiftKey &&
12601262
this.props.shiftSelectItem
12611263
) {
1264+
console.log('shift select item')
12621265
this.props.shiftSelectItem()
1263-
event.preventDefault()
1264-
event.stopPropagation()
12651266
} else {
12661267
this.props.bulkSelectAnnotation()
1267-
event.preventDefault()
1268-
event.stopPropagation()
12691268
}
12701269
}}
12711270
size={16}
@@ -1287,7 +1286,7 @@ export default class AnnotationEditable extends React.Component<Props, State> {
12871286
}
12881287

12891288
handleMouseLeave = () => {
1290-
if (!this.props.focusLockUntilMouseStart) {
1289+
if (!this.props.focusLockUntilMouseStart && !this.isAnyModalOpen()) {
12911290
this.setState({ hoverCard: false })
12921291
if (this.hoverTimeout) {
12931292
clearTimeout(this.hoverTimeout)

src/dashboard-refactor/search-results/components/page-result.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ export default class PageResultView extends PureComponent<Props> {
143143
this.getMatches(this.props.text)
144144
}
145145

146+
private isAnyModalOpen() {
147+
const isOpen =
148+
this.props.listPickerShowStatus != 'hide' ||
149+
this.props.isCopyPasterShown
150+
return isOpen
151+
}
152+
146153
updateMatchingTextContainerHeight = async () => {
147154
await sleepPromise(50)
148155

@@ -333,6 +340,7 @@ export default class PageResultView extends PureComponent<Props> {
333340
}}
334341
strategy={'fixed'}
335342
getPortalRoot={this.props.getRootElement}
343+
instaClose
336344
>
337345
{this.props.renderSpacePicker()}
338346
</PopoutBox>
@@ -352,6 +360,7 @@ export default class PageResultView extends PureComponent<Props> {
352360
}}
353361
strategy={'fixed'}
354362
getPortalRoot={this.props.getRootElement}
363+
instaClose
355364
>
356365
{this.props.renderSpacePicker()}
357366
</PopoutBox>
@@ -948,7 +957,7 @@ export default class PageResultView extends PureComponent<Props> {
948957
}
949958

950959
onUnhover = (event) => {
951-
if (!this.props.focusLockUntilMouseStart) {
960+
if (!this.props.focusLockUntilMouseStart && !this.isAnyModalOpen()) {
952961
this.setState({ hoveredMouse: false })
953962
if (this.hoverTimeout) {
954963
clearTimeout(this.hoverTimeout)

0 commit comments

Comments
 (0)