Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Correct tab order in room preview dialog #7302

Merged
merged 6 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion res/css/views/rooms/_RoomPreviewBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ limitations under the License.
}

.mx_RoomPreviewBar_actions {
flex-direction: column-reverse;
flex-direction: column;
.mx_AccessibleButton {
padding: 7px 50px; //extra wide
}
Expand Down
23 changes: 18 additions & 5 deletions src/components/views/rooms/RoomPreviewBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,26 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
);
}

const isPanel = this.props.canPreview;

const classes = classNames("mx_RoomPreviewBar", "dark-panel", `mx_RoomPreviewBar_${messageCase}`, {
"mx_RoomPreviewBar_panel": this.props.canPreview,
"mx_RoomPreviewBar_dialog": !this.props.canPreview,
"mx_RoomPreviewBar_panel": isPanel,
"mx_RoomPreviewBar_dialog": !isPanel,
});

// ensure correct tab order for both views
const actions = isPanel
? <>
{ secondaryButton }
{ extraComponents }
{ primaryButton }
</>
: <>
{ primaryButton }
{ extraComponents }
{ secondaryButton }
</>;

return (
<div className={classes}>
<div className="mx_RoomPreviewBar_message">
Expand All @@ -606,9 +621,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
</div>
{ reasonElement }
<div className="mx_RoomPreviewBar_actions">
{ secondaryButton }
{ extraComponents }
{ primaryButton }
{ actions }
</div>
<div className="mx_RoomPreviewBar_footer">
{ footer }
Expand Down
Loading