Change Markdown buttons to onClick

`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 https://github.com/vector-im/riot-web/issues/8866
This commit is contained in:
J. Ryan Stinnett 2019-02-22 14:41:27 +00:00
parent ec6c104e51
commit 3e6199c0f7
2 changed files with 2 additions and 2 deletions

View file

@ -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")}

View file

@ -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}