@@ -3,7 +3,6 @@ import * as ReactRedux from 'react-redux';
33import classNames from 'classnames' ;
44import noop from 'lodash/noop' ;
55import { getIsCurrentFileVersion } from '../store' ;
6- import { MOUSE_PRIMARY } from '../constants' ;
76import { Rect } from '../@types/model' ;
87import './HighlightTarget.scss' ;
98
@@ -21,12 +20,6 @@ const HighlightTarget = (props: Props, ref: React.Ref<HighlightTargetRef>): JSX.
2120 const { annotationId, className, onHover = noop , onSelect = noop , shapes } = props ;
2221 const isCurrentFileVersion = ReactRedux . useSelector ( getIsCurrentFileVersion ) ;
2322
24- const handleClick = ( event : React . MouseEvent < HighlightTargetRef > ) : void => {
25- event . preventDefault ( ) ;
26- event . stopPropagation ( ) ;
27- event . nativeEvent . stopImmediatePropagation ( ) ;
28- } ;
29-
3023 const handleFocus = ( ) : void => {
3124 onSelect ( annotationId ) ;
3225 } ;
@@ -39,17 +32,6 @@ const HighlightTarget = (props: Props, ref: React.Ref<HighlightTargetRef>): JSX.
3932 onHover ( null ) ;
4033 } ;
4134
42- const handleMouseDown = ( event : React . MouseEvent < HighlightTargetRef > ) : void => {
43- if ( event . buttons !== MOUSE_PRIMARY ) {
44- return ;
45- }
46-
47- onSelect ( annotationId ) ;
48-
49- event . preventDefault ( ) ; // Prevents focus from leaving the anchor immediately in some browsers
50- event . nativeEvent . stopImmediatePropagation ( ) ; // Prevents document event handlers from executing
51- } ;
52-
5335 return (
5436 // eslint-disable-next-line jsx-a11y/anchor-is-valid
5537 < a
@@ -60,9 +42,7 @@ const HighlightTarget = (props: Props, ref: React.Ref<HighlightTargetRef>): JSX.
6042 data-resin-target = "highlightText"
6143 data-testid = { `ba-AnnotationTarget-${ annotationId } ` }
6244 href = "#"
63- onClick = { handleClick }
6445 onFocus = { handleFocus }
65- onMouseDown = { handleMouseDown }
6646 onMouseEnter = { handleMouseEnter }
6747 onMouseLeave = { handleMouseLeave }
6848 role = "button"
0 commit comments