Merge pull request #3378 from matrix-org/bwindels/cider-md-legend
New composer: show markdown legend on focus
This commit is contained in:
commit
422f482a6d
3 changed files with 58 additions and 4 deletions
|
@ -226,15 +226,21 @@ export default class BasicMessageEditor extends React.Component {
|
|||
return this.getCaret().offset === this._lastTextLength;
|
||||
}
|
||||
|
||||
_onBlur = () => {
|
||||
_onBlur = (event) => {
|
||||
document.removeEventListener("selectionchange", this._onSelectionChange);
|
||||
if (this.props.onBlur) {
|
||||
this.props.onBlur(event);
|
||||
}
|
||||
}
|
||||
|
||||
_onFocus = () => {
|
||||
_onFocus = (event) => {
|
||||
document.addEventListener("selectionchange", this._onSelectionChange);
|
||||
// force to recalculate
|
||||
this._lastSelection = null;
|
||||
this._refreshLastCaretIfNeeded();
|
||||
if (this.props.onFocus) {
|
||||
this.props.onFocus(event);
|
||||
}
|
||||
}
|
||||
|
||||
_onSelectionChange = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue