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

Commit

Permalink
Correct tab order in room preview dialog (#7302)
Browse files Browse the repository at this point in the history
* tab order

* lint fixes

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test RoomPreviewBar

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add copyright header

Signed-off-by: Kerry Archibald <kerrya@element.io>

* Update src/components/views/rooms/RoomPreviewBar.tsx

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* fix tabs/spaces lint for reformatted actions

Signed-off-by: Kerry Archibald <kerrya@element.io>

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
Kerry and t3chguy authored Dec 9, 2021
1 parent 0c850b2 commit d7a6e3e
Show file tree
Hide file tree
Showing 5 changed files with 753 additions and 6 deletions.
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

0 comments on commit d7a6e3e

Please sign in to comment.