basic support for non-editable parts
e.g. pills, they get deleted when any character of them is removed later on we also shouldn't allow the caret to be set inside of them
This commit is contained in:
parent
fc87a27c5d
commit
5e6367ab57
2 changed files with 30 additions and 19 deletions
|
@ -91,6 +91,10 @@ class BasePart {
|
|||
get text() {
|
||||
return this._text;
|
||||
}
|
||||
|
||||
get canEdit() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export class PlainPart extends BasePart {
|
||||
|
@ -165,6 +169,10 @@ class PillPart extends BasePart {
|
|||
node.childNodes.length === 1 &&
|
||||
node.childNodes[0].nodeType === Node.TEXT_NODE;
|
||||
}
|
||||
|
||||
get canEdit() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export class RoomPillPart extends PillPart {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue