Skip to content

Commit

Permalink
Change Markdown buttons to onClick
Browse files Browse the repository at this point in the history
`AccessibleButton` expects click handlers, which we can use here, as long we
make some additional changes to avoid race processing the new state (see
subsequent patch).

Fixes element-hq/element-web#8866
  • Loading branch information
jryans committed Feb 22, 2019
1 parent ec6c104 commit 3e6199c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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 @@ -501,7 +501,7 @@ export default class MessageComposer extends React.Component {
{ formatButtons }
<div style={{ flex: 1 }}></div>
<AccessibleButton className="mx_MessageComposer_formatbar_markdown mx_MessageComposer_markdownDisabled"
onMouseDown={this.onToggleMarkdownClicked}
onClick={this.onToggleMarkdownClicked}
title={_t("Markdown is disabled")}
/>
<AccessibleButton element="img" title={_t("Hide Text Formatting Toolbar")}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ export default class MessageComposerInput extends React.Component {
</div>
<div className={className}>
<AccessibleButton className={markdownClasses}
onMouseDown={this.onMarkdownToggleClicked}
onClick={this.onMarkdownToggleClicked}
title={this.state.isRichTextEnabled ? _t("Markdown is disabled") : _t("Markdown is enabled")}
/>
<Editor ref={this._collectEditor}
Expand Down

0 comments on commit 3e6199c

Please sign in to comment.