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

Commit 76ca036

Browse files
authored
Fix composer format buttons on WebKit (#7898)
1 parent e762a69 commit 76ca036

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

res/css/views/rooms/_MessageComposerFormatBar.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,21 @@ limitations under the License.
3737
display: inline-block;
3838
position: relative;
3939
margin: 2px;
40-
41-
&:hover {
42-
background: $panel-actions;
43-
border-radius: 6px;
44-
z-index: 1;
45-
}
4640
}
4741

4842
.mx_MessageComposerFormatBar_button {
4943
width: 28px;
5044
height: 28px;
5145
box-sizing: border-box;
5246
vertical-align: middle;
47+
background: none;
48+
border: none;
49+
50+
&:hover {
51+
background: $panel-actions;
52+
border-radius: 6px;
53+
z-index: 1;
54+
}
5355
}
5456

5557
.mx_MessageComposerFormatBar_button::after {

src/components/views/rooms/MessageComposerFormatBar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ class FormatButton extends React.PureComponent<IFormatButtonProps> {
103103
</div>
104104
</div>;
105105

106+
// element="button" and type="button" are necessary for the buttons to work on WebKit,
107+
// otherwise the text is deselected before onClick can ever be called
106108
return (
107109
<AccessibleTooltipButton
110+
element="button"
111+
type="button"
108112
onClick={this.props.onClick}
109113
title={this.props.label}
110114
tooltip={tooltip}

0 commit comments

Comments
 (0)