fix some element types reset to selection when the lock is active (#746)
* keep arrows and lines selected if locked * keep element type selected if locked after inserting text * ensure clicking outside doesn't create new text * esc should switch to selection even if locked * reset cursor when creating text via doubleClick Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
@ -2,6 +2,7 @@ import { Action } from "./types";
|
||||
import { KEYS } from "../keys";
|
||||
import { clearSelection } from "../scene";
|
||||
import { isInvisiblySmallElement } from "../element";
|
||||
import { resetCursor } from "../utils";
|
||||
|
||||
export const actionFinalize: Action = {
|
||||
name: "finalize",
|
||||
@ -20,11 +21,17 @@ export const actionFinalize: Action = {
|
||||
}
|
||||
appState.multiElement.shape = null;
|
||||
}
|
||||
if (!appState.elementLocked || !appState.multiElement) {
|
||||
resetCursor();
|
||||
}
|
||||
return {
|
||||
elements: newElements,
|
||||
appState: {
|
||||
...appState,
|
||||
elementType: "selection",
|
||||
elementType:
|
||||
appState.elementLocked && appState.multiElement
|
||||
? appState.elementType
|
||||
: "selection",
|
||||
draggingElement: null,
|
||||
multiElement: null,
|
||||
},
|
||||
|
Reference in New Issue
Block a user