If any of the styled(e.g <b>, <a>) HTML tags are used in default state, the continuing text comes under those tags only.
See original GitHub issueIf the state has <b>hello/<b>
and then we type into the ContentEdittable, then all of the new text comes into the <b>hello new text</>
. For new text to come out of the <b>
the state should have some text written outside the <b>
. E.g <b>hello/<b>.
Here is a codesandbox https://codesandbox.io/s/polished-hooks-xxkxj?file=/src/App.js:0-906
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Tags used in HTML
This is a list of tags used in the HTML language. Each tag starts with a tag opener (a less than sign) and...
Read more >HTML elements reference - HTML: HyperText Markup Language
It only contains text; tags within the element are ignored. ... until styled in some way using CSS (e.g. styling is directly applied...
Read more >WebD2: Common HTML Tags - University of Washington
Tags in HTML are not case sensitive, but in XHTML all tags must be in lower case. Even when coding in HTML, you...
Read more >HTML pre tag - W3Schools
The <pre> tag defines preformatted text. Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces...
Read more >Quick guide to modernize HTML formatting tags in your survey
Below is an example that recently came my way. Note how the HTML tags used to center the text (<center>) and to enlarge...
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
Hello. I don’t think this is an issue with react-contenteditable. This is just how contenteditable works in the browser. It’s your application’s responsibility to handle that case.
I think a lucky day for me. 😃 Adding a
contenteditable="false"
to the custom HTML added will bring the continuing text out of this custom HTML.setMessage(`${message}<span class="variable-text" contenteditable="false">${variable}</span>`)