mirror of
https://github.com/penpot/penpot.git
synced 2026-09-12 15:09:38 +00:00
🚑 Hot fix for text editor internal error
This commit is contained in:
parent
c4aa51bc01
commit
e9b2e9e818
@ -702,7 +702,8 @@ export function isEmpty(instance) {
|
|||||||
if (isTextEditor(instance)) {
|
if (isTextEditor(instance)) {
|
||||||
return instance.isEmpty;
|
return instance.isEmpty;
|
||||||
}
|
}
|
||||||
throw new TypeError('Instance is not a TextEditor');
|
return null;
|
||||||
|
// throw new TypeError('Instance is not a TextEditor');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -716,7 +717,8 @@ export function getRoot(instance) {
|
|||||||
if (isTextEditor(instance)) {
|
if (isTextEditor(instance)) {
|
||||||
return instance.root;
|
return instance.root;
|
||||||
}
|
}
|
||||||
throw new TypeError("Instance is not a TextEditor");
|
return null;
|
||||||
|
// throw new TypeError("Instance is not a TextEditor");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -729,9 +731,10 @@ export function getRoot(instance) {
|
|||||||
export function setRoot(instance, root) {
|
export function setRoot(instance, root) {
|
||||||
if (isTextEditor(instance)) {
|
if (isTextEditor(instance)) {
|
||||||
instance.root = root;
|
instance.root = root;
|
||||||
return instance;
|
// return instance;
|
||||||
}
|
}
|
||||||
throw new TypeError("Instance is not a TextEditor");
|
return instance;
|
||||||
|
// throw new TypeError("Instance is not a TextEditor");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -756,7 +759,8 @@ export function getCurrentStyle(instance) {
|
|||||||
if (isTextEditor(instance)) {
|
if (isTextEditor(instance)) {
|
||||||
return instance.currentStyle;
|
return instance.currentStyle;
|
||||||
}
|
}
|
||||||
throw new TypeError("Instance is not a TextEditor");
|
// throw new TypeError("Instance is not a TextEditor");
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -771,7 +775,8 @@ export function applyStylesToSelection(instance, styles) {
|
|||||||
if (isTextEditor(instance)) {
|
if (isTextEditor(instance)) {
|
||||||
return instance.applyStylesToSelection(styles);
|
return instance.applyStylesToSelection(styles);
|
||||||
}
|
}
|
||||||
throw new TypeError("Instance is not a TextEditor");
|
// throw new TypeError("Instance is not a TextEditor");
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -785,7 +790,8 @@ export function dispose(instance) {
|
|||||||
if (isTextEditor(instance)) {
|
if (isTextEditor(instance)) {
|
||||||
return instance.dispose();
|
return instance.dispose();
|
||||||
}
|
}
|
||||||
throw new TypeError("Instance is not a TextEditor");
|
// throw new TypeError("Instance is not a TextEditor");
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TextEditor;
|
export default TextEditor;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user