Fix composer format buttons on WebKit (#7898)

This commit is contained in:
Robin 2022-02-25 08:20:06 -05:00 committed by GitHub
parent e762a6947d
commit 76ca0362e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -37,12 +37,6 @@ limitations under the License.
display: inline-block; display: inline-block;
position: relative; position: relative;
margin: 2px; margin: 2px;
&:hover {
background: $panel-actions;
border-radius: 6px;
z-index: 1;
}
} }
.mx_MessageComposerFormatBar_button { .mx_MessageComposerFormatBar_button {
@ -50,6 +44,14 @@ limitations under the License.
height: 28px; height: 28px;
box-sizing: border-box; box-sizing: border-box;
vertical-align: middle; vertical-align: middle;
background: none;
border: none;
&:hover {
background: $panel-actions;
border-radius: 6px;
z-index: 1;
}
} }
.mx_MessageComposerFormatBar_button::after { .mx_MessageComposerFormatBar_button::after {

View file

@ -103,8 +103,12 @@ class FormatButton extends React.PureComponent<IFormatButtonProps> {
</div> </div>
</div>; </div>;
// element="button" and type="button" are necessary for the buttons to work on WebKit,
// otherwise the text is deselected before onClick can ever be called
return ( return (
<AccessibleTooltipButton <AccessibleTooltipButton
element="button"
type="button"
onClick={this.props.onClick} onClick={this.props.onClick}
title={this.props.label} title={this.props.label}
tooltip={tooltip} tooltip={tooltip}