You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
hide formatting bar for MD editor
This commit is contained in:
@@ -354,7 +354,7 @@ export default class MessageComposer extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let formatBar;
|
let formatBar;
|
||||||
if (this.state.showFormatting) {
|
if (this.state.showFormatting && this.state.inputState.isRichTextEnabled) {
|
||||||
const {marks, blockType} = this.state.inputState;
|
const {marks, blockType} = this.state.inputState;
|
||||||
const formatButtons = ["bold", "italic", "deleted", "underlined", "code", "block-quote", "bulleted-list", "numbered-list"].map(
|
const formatButtons = ["bold", "italic", "deleted", "underlined", "code", "block-quote", "bulleted-list", "numbered-list"].map(
|
||||||
(name) => {
|
(name) => {
|
||||||
|
|||||||
@@ -1405,9 +1405,7 @@ export default class MessageComposerInput extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onFormatButtonClicked = (name, e) => {
|
onFormatButtonClicked = (name, e) => {
|
||||||
if (e) {
|
e.preventDefault(); // don't steal focus from the editor!
|
||||||
e.preventDefault(); // don't steal focus from the editor!
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX: horrible evil hack to ensure the editor is focused so the act
|
// XXX: horrible evil hack to ensure the editor is focused so the act
|
||||||
// of focusing it doesn't then cancel the format button being pressed
|
// of focusing it doesn't then cancel the format button being pressed
|
||||||
|
|||||||
Reference in New Issue
Block a user