mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: Paste clipboard contents into unbound text elements (#5849)
* Fix #5848. * Add test. * some tweaks Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
e201e79cd0
commit
a0ecfed4cd
2 changed files with 26 additions and 8 deletions
|
@ -290,17 +290,14 @@ export const textWysiwyg = ({
|
|||
fontSize: app.state.currentItemFontSize,
|
||||
fontFamily: app.state.currentItemFontFamily,
|
||||
});
|
||||
const wrappedText = container
|
||||
? wrapText(data, font, getMaxContainerWidth(container))
|
||||
: data;
|
||||
|
||||
const wrappedText = wrapText(
|
||||
data,
|
||||
font,
|
||||
getMaxContainerWidth(container!),
|
||||
);
|
||||
const dimensions = measureText(wrappedText, font);
|
||||
editable.style.height = `${dimensions.height}px`;
|
||||
if (data) {
|
||||
onChange(wrappedText);
|
||||
}
|
||||
|
||||
onChange(wrappedText);
|
||||
};
|
||||
editable.oninput = () => {
|
||||
const updatedTextElement = Scene.getScene(element)?.getElement(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue