mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
e2cc961c76
commit
bac20fa641
2 changed files with 21 additions and 32 deletions
|
@ -32,14 +32,12 @@ export const textWysiwyg = ({
|
|||
zoom,
|
||||
onChange,
|
||||
onSubmit,
|
||||
onCancel,
|
||||
getViewportCoords,
|
||||
}: {
|
||||
id: ExcalidrawElement["id"];
|
||||
zoom: number;
|
||||
onChange?: (text: string) => void;
|
||||
onSubmit: (text: string) => void;
|
||||
onCancel: () => void;
|
||||
getViewportCoords: (x: number, y: number) => [number, number];
|
||||
}) => {
|
||||
function updateWysiwygStyle() {
|
||||
|
@ -129,11 +127,7 @@ export const textWysiwyg = ({
|
|||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (editable.value) {
|
||||
onSubmit(normalizeText(editable.value));
|
||||
} else {
|
||||
onCancel();
|
||||
}
|
||||
onSubmit(normalizeText(editable.value));
|
||||
cleanup();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue