mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: remove embeddable
from generic elements (#6853)
This commit is contained in:
parent
bb985eba3a
commit
083bcf802c
6 changed files with 39 additions and 16 deletions
|
@ -5395,7 +5395,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
width: embedLink.aspectRatio.w,
|
||||
height: embedLink.aspectRatio.h,
|
||||
link,
|
||||
validated: undefined,
|
||||
validated: null,
|
||||
});
|
||||
|
||||
this.scene.replaceAllElements([
|
||||
|
@ -5583,7 +5583,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
}
|
||||
|
||||
private createGenericElementOnPointerDown = (
|
||||
elementType: ExcalidrawGenericElement["type"],
|
||||
elementType: ExcalidrawGenericElement["type"] | "embeddable",
|
||||
pointerDownState: PointerDownState,
|
||||
): void => {
|
||||
const [gridX, gridY] = getGridPoint(
|
||||
|
@ -5597,8 +5597,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
y: gridY,
|
||||
});
|
||||
|
||||
const element = newElement({
|
||||
type: elementType,
|
||||
const baseElementAttributes = {
|
||||
x: gridX,
|
||||
y: gridY,
|
||||
strokeColor: this.state.currentItemStrokeColor,
|
||||
|
@ -5611,8 +5610,21 @@ class App extends React.Component<AppProps, AppState> {
|
|||
roundness: this.getCurrentItemRoundness(elementType),
|
||||
locked: false,
|
||||
frameId: topLayerFrame ? topLayerFrame.id : null,
|
||||
...(elementType === "embeddable" ? { validated: false } : {}),
|
||||
});
|
||||
} as const;
|
||||
|
||||
let element;
|
||||
if (elementType === "embeddable") {
|
||||
element = newEmbeddableElement({
|
||||
type: "embeddable",
|
||||
validated: null,
|
||||
...baseElementAttributes,
|
||||
});
|
||||
} else {
|
||||
element = newElement({
|
||||
type: elementType,
|
||||
...baseElementAttributes,
|
||||
});
|
||||
}
|
||||
|
||||
if (element.type === "selection") {
|
||||
this.setState({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue