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

Commit

Permalink
Use regular divs for Markdown buttons
Browse files Browse the repository at this point in the history
The Markdown toggles need to watch `mousedown` to properly update state, so
let's drop back down to regular `div`s.

This also fixes element-hq/element-web#8866.
  • Loading branch information
jryans committed Feb 21, 2019
1 parent 8b66b6b commit 70561b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ export default class MessageComposer extends React.Component {
<div className="mx_MessageComposer_formatbar">
{ formatButtons }
<div style={{ flex: 1 }}></div>
<AccessibleButton className="mx_MessageComposer_formatbar_markdown mx_MessageComposer_markdownDisabled"
<div className="mx_MessageComposer_formatbar_markdown mx_MessageComposer_markdownDisabled"
onMouseDown={this.onToggleMarkdownClicked}
title={_t("Markdown is disabled")}
/>
Expand Down
3 changes: 1 addition & 2 deletions src/components/views/rooms/MessageComposerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import ReplyPreview from "./ReplyPreview";
import RoomViewStore from '../../../stores/RoomViewStore';
import ReplyThread from "../elements/ReplyThread";
import {ContentHelpers} from 'matrix-js-sdk';
import AccessibleButton from '../elements/AccessibleButton';

const EMOJI_UNICODE_TO_SHORTNAME = mapUnicodeToShort();
const REGEX_EMOJI_WHITESPACE = new RegExp('(?:^|\\s)(' + asciiRegexp + ')\\s$');
Expand Down Expand Up @@ -1602,7 +1601,7 @@ export default class MessageComposerInput extends React.Component {
/>
</div>
<div className={className}>
<AccessibleButton className={markdownClasses}
<div className={markdownClasses}
onMouseDown={this.onMarkdownToggleClicked}
title={this.state.isRichTextEnabled ? _t("Markdown is disabled") : _t("Markdown is enabled")}
/>
Expand Down

0 comments on commit 70561b3

Please sign in to comment.