How can I create a new line inside a text element?
See original GitHub issueIn the documentation example (https://konvajs.org/docs/shapes/Text.html) it shows that I can use \n to create a new line, but it doesn’t work for some reason.
var complexText = new Konva.Text({
x: 20,
y: 60,
text:
"COMPLEX TEXT\n\nAll the world's a stage, and all the men and women merely players. They have their exits and their entrances.",
fontSize: 18,
fontFamily: 'Calibri',
fill: '#555',
width: 300,
padding: 20,
align: 'center'
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Line break in HTML with '\n' - Stack Overflow
The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the...
Read more ><br>: The Line Break element - HTML - MDN Web Docs - Mozilla
The HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division...
Read more >Add a Line Break in HTML - Tutorial - TeachUcomp, Inc.
To add a line break to your HTML code, you use the <br> tag. The <br> tag does not have an end tag....
Read more >HTML New Line – How to Add a Line Break with the BR Tag
In this article, I'll explain what line breaks are and show you how to create them in HTML. What is a Line Break?...
Read more >How to Create a New Line in a P Tag of HTML - Computer Hope
Most programs and online forms support the Shift + Enter keyboard shortcut. To use this shortcut, move to the text cursor to where...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Works just fine: https://codesandbox.io/s/react-konva-multiline-text-repi0
I need to remove the listener of the enter key to create a new line, thanks.