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

Fix composer format buttons on WebKit #7898

Merged
merged 2 commits into from
Feb 25, 2022
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
14 changes: 8 additions & 6 deletions res/css/views/rooms/_MessageComposerFormatBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ limitations under the License.
display: inline-block;
position: relative;
margin: 2px;

&:hover {
background: $panel-actions;
border-radius: 6px;
z-index: 1;
}
}

.mx_MessageComposerFormatBar_button {
width: 28px;
height: 28px;
box-sizing: border-box;
vertical-align: middle;
background: none;
border: none;

&:hover {
background: $panel-actions;
border-radius: 6px;
z-index: 1;
}
}

.mx_MessageComposerFormatBar_button::after {
Expand Down
4 changes: 4 additions & 0 deletions src/components/views/rooms/MessageComposerFormatBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ class FormatButton extends React.PureComponent<IFormatButtonProps> {
</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 (
<AccessibleTooltipButton
element="button"
type="button"
onClick={this.props.onClick}
title={this.props.label}
tooltip={tooltip}
Expand Down