mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
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:
parent
1ec3946ed6
commit
fa12125db0
3 changed files with 46 additions and 15 deletions
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue