Revert "A11y: move focus to right panel when opened" (#30999)
* Revert "A11y: move focus to right panel when opened (#30553)"
This reverts commit 0c498a66b1.
* test(e2e): update test
This commit is contained in:
@@ -218,7 +218,7 @@ export class ElementAppPage {
|
|||||||
*/
|
*/
|
||||||
public async inviteUserToCurrentRoom(userId: string): Promise<void> {
|
public async inviteUserToCurrentRoom(userId: string): Promise<void> {
|
||||||
await this.toggleRoomInfoPanel(); // TODO skip this if the room info panel is already open
|
await this.toggleRoomInfoPanel(); // TODO skip this if the room info panel is already open
|
||||||
await this.page.getByLabel("Right panel").getByRole("menuitem", { name: "Invite" }).click();
|
await this.page.getByTestId("right-panel").getByRole("menuitem", { name: "Invite" }).click();
|
||||||
|
|
||||||
const input = this.page.getByRole("dialog").getByTestId("invite-dialog-input");
|
const input = this.page.getByRole("dialog").getByTestId("invite-dialog-input");
|
||||||
await input.fill(userId);
|
await input.fill(userId);
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
@@ -34,7 +34,6 @@ import { Action } from "../../dispatcher/actions";
|
|||||||
import { type XOR } from "../../@types/common";
|
import { type XOR } from "../../@types/common";
|
||||||
import ExtensionsCard from "../views/right_panel/ExtensionsCard";
|
import ExtensionsCard from "../views/right_panel/ExtensionsCard";
|
||||||
import MemberListView from "../views/rooms/MemberList/MemberListView";
|
import MemberListView from "../views/rooms/MemberList/MemberListView";
|
||||||
import { _t } from "../../languageHandler";
|
|
||||||
|
|
||||||
interface BaseProps {
|
interface BaseProps {
|
||||||
overwriteCard?: IRightPanelCard; // used to display a custom card and ignoring the RightPanelStore (used for UserView)
|
overwriteCard?: IRightPanelCard; // used to display a custom card and ignoring the RightPanelStore (used for UserView)
|
||||||
@@ -65,7 +64,6 @@ interface IState {
|
|||||||
export default class RightPanel extends React.Component<Props, IState> {
|
export default class RightPanel extends React.Component<Props, IState> {
|
||||||
public static contextType = MatrixClientContext;
|
public static contextType = MatrixClientContext;
|
||||||
declare public context: React.ContextType<typeof MatrixClientContext>;
|
declare public context: React.ContextType<typeof MatrixClientContext>;
|
||||||
private ref = React.createRef<HTMLDivElement>();
|
|
||||||
|
|
||||||
public constructor(props: Props) {
|
public constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -84,7 +82,6 @@ export default class RightPanel extends React.Component<Props, IState> {
|
|||||||
public componentDidMount(): void {
|
public componentDidMount(): void {
|
||||||
this.context.on(RoomStateEvent.Members, this.onRoomStateMember);
|
this.context.on(RoomStateEvent.Members, this.onRoomStateMember);
|
||||||
RightPanelStore.instance.on(UPDATE_EVENT, this.onRightPanelStoreUpdate);
|
RightPanelStore.instance.on(UPDATE_EVENT, this.onRightPanelStoreUpdate);
|
||||||
this.ref.current?.focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillUnmount(): void {
|
public componentWillUnmount(): void {
|
||||||
@@ -122,13 +119,7 @@ export default class RightPanel extends React.Component<Props, IState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private onRightPanelStoreUpdate = (): void => {
|
private onRightPanelStoreUpdate = (): void => {
|
||||||
const oldPhase = this.state.phase;
|
this.setState({ ...(RightPanel.getDerivedStateFromProps(this.props) as IState) });
|
||||||
const newState = RightPanel.getDerivedStateFromProps(this.props) as IState;
|
|
||||||
this.setState({ ...newState });
|
|
||||||
|
|
||||||
if (oldPhase !== newState.phase) {
|
|
||||||
this.ref.current?.focus();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private onClose = (): void => {
|
private onClose = (): void => {
|
||||||
@@ -289,14 +280,7 @@ export default class RightPanel extends React.Component<Props, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside
|
<aside className="mx_RightPanel" id="mx_RightPanel" data-testid="right-panel">
|
||||||
aria-label={_t("right_panel|title")}
|
|
||||||
ref={this.ref}
|
|
||||||
className="mx_RightPanel"
|
|
||||||
id="mx_RightPanel"
|
|
||||||
data-testid="right-panel"
|
|
||||||
tabIndex={-1}
|
|
||||||
>
|
|
||||||
{card}
|
{card}
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1917,7 +1917,6 @@
|
|||||||
"thread_list": {
|
"thread_list": {
|
||||||
"context_menu_label": "Thread options"
|
"context_menu_label": "Thread options"
|
||||||
},
|
},
|
||||||
"title": "Right panel",
|
|
||||||
"video_room_chat": {
|
"video_room_chat": {
|
||||||
"title": "Chat"
|
"title": "Chat"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1958,11 +1958,9 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
|
|||||||
style="position: relative; user-select: auto; width: 420px; height: 100%; max-width: 50%; min-width: 320px; box-sizing: border-box; flex-shrink: 0;"
|
style="position: relative; user-select: auto; width: 420px; height: 100%; max-width: 50%; min-width: 320px; box-sizing: border-box; flex-shrink: 0;"
|
||||||
>
|
>
|
||||||
<aside
|
<aside
|
||||||
aria-label="Right panel"
|
|
||||||
class="mx_RightPanel"
|
class="mx_RightPanel"
|
||||||
data-testid="right-panel"
|
data-testid="right-panel"
|
||||||
id="mx_RightPanel"
|
id="mx_RightPanel"
|
||||||
tabindex="-1"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="mx_BaseCard mx_ThreadPanel mx_TimelineCard"
|
class="mx_BaseCard mx_ThreadPanel mx_TimelineCard"
|
||||||
|
|||||||
@@ -3,11 +3,9 @@
|
|||||||
exports[`AppTile destroys non-persisted right panel widget on room change 1`] = `
|
exports[`AppTile destroys non-persisted right panel widget on room change 1`] = `
|
||||||
<DocumentFragment>
|
<DocumentFragment>
|
||||||
<aside
|
<aside
|
||||||
aria-label="Right panel"
|
|
||||||
class="mx_RightPanel"
|
class="mx_RightPanel"
|
||||||
data-testid="right-panel"
|
data-testid="right-panel"
|
||||||
id="mx_RightPanel"
|
id="mx_RightPanel"
|
||||||
tabindex="-1"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="mx_BaseCard mx_WidgetCard"
|
class="mx_BaseCard mx_WidgetCard"
|
||||||
|
|||||||
Reference in New Issue
Block a user