-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If any of the styled(e.g <b>, <a>) HTML tags are used in default state, the continuing text comes under those tags only. #198
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 made it working through my code. Moving the caret to the last. |
can you share how you do that? I have the same issue here, thank you! |
@Puspendert Can you please share how did you do that? Having the same issue. |
@im-amir Not sure what I wanted to do and what solution did I put 😅. But doesn't the codesandbox link above provide a solution? |
Nope, I tried to add the useEffect code in my change handler, but the issue is still same. The continuing text comes inside the last added html tag. :( |
If 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
The text was updated successfully, but these errors were encountered: