Merge pull request #3108 from matrix-org/bwindels/edit-room-notif-pill
Support @room pills while editing
This commit is contained in:
commit
63fba611c0
6 changed files with 136 additions and 93 deletions
|
@ -233,7 +233,7 @@ export default class MessageEditor extends React.Component {
|
|||
parts = editState.getSerializedParts().map(p => partCreator.deserializePart(p));
|
||||
} else {
|
||||
// otherwise, parse the body of the event
|
||||
parts = parseEvent(editState.getEvent(), room, this.context.matrixClient);
|
||||
parts = parseEvent(editState.getEvent(), partCreator);
|
||||
}
|
||||
|
||||
return new EditorModel(
|
||||
|
|
|
@ -214,7 +214,13 @@ module.exports = React.createClass({
|
|||
// update the current node with one that's now taken its place
|
||||
node = pillContainer;
|
||||
}
|
||||
} else if (node.nodeType === Node.TEXT_NODE) {
|
||||
} else if (
|
||||
node.nodeType === Node.TEXT_NODE &&
|
||||
// as applying pills happens outside of react, make sure we're not doubly
|
||||
// applying @room pills here, as a rerender with the same content won't touch the DOM
|
||||
// to clear the pills from the last run of pillifyLinks
|
||||
!node.parentElement.classList.contains("mx_AtRoomPill")
|
||||
) {
|
||||
const Pill = sdk.getComponent('elements.Pill');
|
||||
|
||||
let currentTextNode = node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue