mirror of
https://github.com/excalidraw/excalidraw.git
synced 2024-11-02 03:25:53 +01:00
setActiveTool - do not clear selectedElementIds so customData of image can be used & do not render when deferredText is empty
This commit is contained in:
parent
482178b7b6
commit
b8ae1d2486
@ -3116,7 +3116,8 @@ class App extends React.Component<AppProps, AppState> {
|
||||
| "eraser"
|
||||
| "hand"
|
||||
| "frame"
|
||||
| "embeddable";
|
||||
| "embeddable"
|
||||
| "mermaid";
|
||||
}
|
||||
| { type: "custom"; customType: string },
|
||||
) => {
|
||||
@ -3138,7 +3139,12 @@ class App extends React.Component<AppProps, AppState> {
|
||||
if (nextActiveTool.type !== "selection") {
|
||||
this.setState({
|
||||
activeTool: nextActiveTool,
|
||||
selectedElementIds: makeNextSelectedElementIds({}, this.state),
|
||||
selectedElementIds: makeNextSelectedElementIds(
|
||||
nextActiveTool.type === "mermaid"
|
||||
? this.state.selectedElementIds
|
||||
: {},
|
||||
this.state,
|
||||
),
|
||||
selectedGroupIds: {},
|
||||
editingGroupId: null,
|
||||
activeEmbeddable: null,
|
||||
|
@ -129,7 +129,11 @@ const MermaidToExcalidraw = ({
|
||||
useEffect(() => {
|
||||
const renderExcalidrawPreview = async () => {
|
||||
const canvasNode = canvasRef.current;
|
||||
if (!canvasNode || !mermaidToExcalidrawLib.current) {
|
||||
if (
|
||||
!canvasNode ||
|
||||
!mermaidToExcalidrawLib.current ||
|
||||
deferredText === ""
|
||||
) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user