@@ -71,9 +71,6 @@ interface IProps {
7171 viaServers ?: string [ ] ;
7272 hideToSRUsers : boolean ;
7373 resizeNotifier : ResizeNotifier ;
74- middleDisabled : boolean ;
75- leftDisabled : boolean ;
76- rightDisabled : boolean ;
7774 // eslint-disable-next-line camelcase
7875 page_type : string ;
7976 autoJoin : boolean ;
@@ -100,10 +97,6 @@ interface IUsageLimit {
10097}
10198
10299interface IState {
103- mouseDown ?: {
104- x : number ;
105- y : number ;
106- } ;
107100 syncErrorData ?: {
108101 error : {
109102 data : IUsageLimit ;
@@ -151,7 +144,6 @@ class LoggedInView extends React.Component<IProps, IState> {
151144 super ( props , context ) ;
152145
153146 this . state = {
154- mouseDown : undefined ,
155147 syncErrorData : undefined ,
156148 // use compact timeline view
157149 useCompactLayout : SettingsStore . getValue ( 'useCompactLayout' ) ,
@@ -549,48 +541,6 @@ class LoggedInView extends React.Component<IProps, IState> {
549541 ) , true ) ;
550542 } ;
551543
552- _onMouseDown = ( ev ) => {
553- // When the panels are disabled, clicking on them results in a mouse event
554- // which bubbles to certain elements in the tree. When this happens, close
555- // any settings page that is currently open (user/room/group).
556- if ( this . props . leftDisabled && this . props . rightDisabled ) {
557- const targetClasses = new Set ( ev . target . className . split ( ' ' ) ) ;
558- if (
559- targetClasses . has ( 'mx_MatrixChat' ) ||
560- targetClasses . has ( 'mx_MatrixChat_middlePanel' ) ||
561- targetClasses . has ( 'mx_RoomView' )
562- ) {
563- this . setState ( {
564- mouseDown : {
565- x : ev . pageX ,
566- y : ev . pageY ,
567- } ,
568- } ) ;
569- }
570- }
571- } ;
572-
573- _onMouseUp = ( ev ) => {
574- if ( ! this . state . mouseDown ) return ;
575-
576- const deltaX = ev . pageX - this . state . mouseDown . x ;
577- const deltaY = ev . pageY - this . state . mouseDown . y ;
578- const distance = Math . sqrt ( ( deltaX * deltaX ) + ( deltaY + deltaY ) ) ;
579- const maxRadius = 5 ; // People shouldn't be straying too far, hopefully
580-
581- // Note: we track how far the user moved their mouse to help
582- // combat against https://github.com/vector-im/element-web/issues/7158
583-
584- if ( distance < maxRadius ) {
585- // This is probably a real click, and not a drag
586- dis . dispatch ( { action : 'close_settings' } ) ;
587- }
588-
589- // Always clear the mouseDown state to ensure we don't accidentally
590- // use stale values due to the mouseDown checks.
591- this . setState ( { mouseDown : null } ) ;
592- } ;
593-
594544 render ( ) {
595545 const RoomView = sdk . getComponent ( 'structures.RoomView' ) ;
596546 const UserView = sdk . getComponent ( 'structures.UserView' ) ;
@@ -610,7 +560,6 @@ class LoggedInView extends React.Component<IProps, IState> {
610560 oobData = { this . props . roomOobData }
611561 viaServers = { this . props . viaServers }
612562 key = { this . props . currentRoomId || 'roomview' }
613- disabled = { this . props . middleDisabled }
614563 resizeNotifier = { this . props . resizeNotifier }
615564 /> ;
616565 break ;
@@ -658,8 +607,6 @@ class LoggedInView extends React.Component<IProps, IState> {
658607 onKeyDown = { this . _onReactKeyDown }
659608 className = 'mx_MatrixChat_wrapper'
660609 aria-hidden = { this . props . hideToSRUsers }
661- onMouseDown = { this . _onMouseDown }
662- onMouseUp = { this . _onMouseUp }
663610 >
664611 < ToastContainer />
665612 < DragDropContext onDragEnd = { this . _onDragEnd } >
0 commit comments