@@ -34,7 +34,6 @@ import { Action } from "../../dispatcher/actions";
3434import { type XOR } from "../../@types/common" ;
3535import ExtensionsCard from "../views/right_panel/ExtensionsCard" ;
3636import MemberListView from "../views/rooms/MemberList/MemberListView" ;
37- import { _t } from "../../languageHandler" ;
3837
3938interface BaseProps {
4039 overwriteCard ?: IRightPanelCard ; // used to display a custom card and ignoring the RightPanelStore (used for UserView)
@@ -65,7 +64,6 @@ interface IState {
6564export default class RightPanel extends React . Component < Props , IState > {
6665 public static contextType = MatrixClientContext ;
6766 declare public context : React . ContextType < typeof MatrixClientContext > ;
68- private ref = React . createRef < HTMLDivElement > ( ) ;
6967
7068 public constructor ( props : Props ) {
7169 super ( props ) ;
@@ -84,7 +82,6 @@ export default class RightPanel extends React.Component<Props, IState> {
8482 public componentDidMount ( ) : void {
8583 this . context . on ( RoomStateEvent . Members , this . onRoomStateMember ) ;
8684 RightPanelStore . instance . on ( UPDATE_EVENT , this . onRightPanelStoreUpdate ) ;
87- this . ref . current ?. focus ( ) ;
8885 }
8986
9087 public componentWillUnmount ( ) : void {
@@ -122,13 +119,7 @@ export default class RightPanel extends React.Component<Props, IState> {
122119 } ;
123120
124121 private onRightPanelStoreUpdate = ( ) : void => {
125- const oldPhase = this . state . phase ;
126- const newState = RightPanel . getDerivedStateFromProps ( this . props ) as IState ;
127- this . setState ( { ...newState } ) ;
128-
129- if ( oldPhase !== newState . phase ) {
130- this . ref . current ?. focus ( ) ;
131- }
122+ this . setState ( { ...( RightPanel . getDerivedStateFromProps ( this . props ) as IState ) } ) ;
132123 } ;
133124
134125 private onClose = ( ) : void => {
@@ -289,14 +280,7 @@ export default class RightPanel extends React.Component<Props, IState> {
289280 }
290281
291282 return (
292- < aside
293- aria-label = { _t ( "right_panel|title" ) }
294- ref = { this . ref }
295- className = "mx_RightPanel"
296- id = "mx_RightPanel"
297- data-testid = "right-panel"
298- tabIndex = { - 1 }
299- >
283+ < aside className = "mx_RightPanel" id = "mx_RightPanel" data-testid = "right-panel" >
300284 { card }
301285 </ aside >
302286 ) ;
0 commit comments