Allows commenting outside edit mode when seamless editing is disabled. (#5422)
This commit is contained in:
@@ -41,6 +41,10 @@ export default class Extension {
|
||||
return {};
|
||||
}
|
||||
|
||||
get allowInReadOnly(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
keys(_options: {
|
||||
type?: NodeType | MarkType;
|
||||
schema: Schema;
|
||||
|
||||
@@ -205,7 +205,7 @@ export default class ExtensionManager {
|
||||
callback: CommandFactory,
|
||||
attrs: Record<string, any>
|
||||
) => {
|
||||
if (!view.editable) {
|
||||
if (!view.editable && !extension.allowInReadOnly) {
|
||||
return false;
|
||||
}
|
||||
view.focus();
|
||||
|
||||
Reference in New Issue
Block a user