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

Commit 4dc9ef9

Browse files
committed
Fix vertical spacing in compact context menus
Fix element-hq/element-web#20801 Regressed in #7339 Relevant styles were first added in #4858 (context behind why the original styles were added)
1 parent 9ffc141 commit 4dc9ef9

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

res/css/views/context_menus/_IconizedContextMenu.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ limitations under the License.
5050
}
5151

5252
// round the top corners of the top button for the hover effect to be bounded
53-
&:first-child .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind):first-child {
53+
&:first-child .mx_IconizedContextMenu_item:first-child {
5454
border-radius: 8px 8px 0 0; // radius matches .mx_ContextualMenu
5555
}
5656

5757
// round the bottom corners of the bottom button for the hover effect to be bounded
58-
&:last-child .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind):last-child {
58+
&:last-child .mx_IconizedContextMenu_item:last-child {
5959
border-radius: 0 0 8px 8px; // radius matches .mx_ContextualMenu
6060
}
6161

6262
// round all corners of the only button for the hover effect to be bounded
63-
&:first-child:last-child .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind):first-child:last-child {
63+
&:first-child:last-child .mx_IconizedContextMenu_item:first-child:last-child {
6464
border-radius: 8px; // radius matches .mx_ContextualMenu
6565
}
6666

67-
.mx_AccessibleButton:not(.mx_AccessibleButton_hasKind) {
67+
.mx_IconizedContextMenu_item {
6868
// pad the inside of the button so that the hover background is padded too
6969
padding-top: 12px;
7070
padding-bottom: 12px;
@@ -130,7 +130,7 @@ limitations under the License.
130130
}
131131

132132
.mx_IconizedContextMenu_optionList_red {
133-
.mx_AccessibleButton:not(.mx_AccessibleButton_hasKind) {
133+
.mx_IconizedContextMenu_item {
134134
color: $alert !important;
135135
}
136136

@@ -148,7 +148,7 @@ limitations under the License.
148148
}
149149

150150
.mx_IconizedContextMenu_active {
151-
&.mx_AccessibleButton:not(.mx_AccessibleButton_hasKind), .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind) {
151+
&.mx_IconizedContextMenu_item, .mx_IconizedContextMenu_item {
152152
color: $accent !important;
153153
}
154154

res/css/views/messages/_JumpToDatePicker.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ limitations under the License.
1616

1717
.mx_JumpToDatePicker_form {
1818
display: flex;
19+
padding-top: 12px;
20+
padding-bottom: 12px;
1921
}
2022

2123
.mx_JumpToDatePicker_label {

src/components/views/context_menus/IconizedContextMenu.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const IconizedContextMenuRadio: React.FC<IRadioProps> = ({
5959
return <MenuItemRadio
6060
{...props}
6161
className={classNames(className, {
62+
"mx_IconizedContextMenu_item": true,
6263
mx_IconizedContextMenu_active: active,
6364
})}
6465
active={active}
@@ -93,6 +94,7 @@ export const IconizedContextMenuCheckbox: React.FC<ICheckboxProps> = ({
9394
return <MenuItemCheckbox
9495
{...props}
9596
className={classNames(className, {
97+
"mx_IconizedContextMenu_item": true,
9698
mx_IconizedContextMenu_active: active,
9799
})}
98100
active={active}
@@ -105,7 +107,7 @@ export const IconizedContextMenuCheckbox: React.FC<ICheckboxProps> = ({
105107
};
106108

107109
export const IconizedContextMenuOption: React.FC<IOptionProps> = ({ label, iconClassName, children, ...props }) => {
108-
return <MenuItem {...props} label={label}>
110+
return <MenuItem {...props} className="mx_IconizedContextMenu_item" label={label}>
109111
{ iconClassName && <span className={classNames("mx_IconizedContextMenu_icon", iconClassName)} /> }
110112
<span className="mx_IconizedContextMenu_label">{ label }</span>
111113
{ children }

src/components/views/messages/DateSeparator.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ export default class DateSeparator extends React.Component<IProps, IState> {
193193
if (this.state.contextMenuPosition) {
194194
contextMenu = <IconizedContextMenu
195195
{...contextMenuBelow(this.state.contextMenuPosition)}
196-
compact
197196
onFinished={this.onContextMenuCloseClick}
198197
>
199198
<IconizedContextMenuOptionList first>

0 commit comments

Comments
 (0)