Is it possible to register divs with contenteditable=true ? #1710
-
Hi, I need to create an input field where if the user types specific words, they become bold. Unfortunately, I can't do that with an input/textarea element. I tried to create a div with the attribute contenteditable set to true, but I'm not able to register its ref. Is there any other way I can achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I think you will need a custom register
and |
Beta Was this translation helpful? Give feedback.
-
There is a more complete answer here. First register your div contenteditable:
Then inside the div editable do this:
Important here is to include the shouldValidate inside the onInput of the div contenteditable. |
Beta Was this translation helpful? Give feedback.
There is a more complete answer here.
First register your div contenteditable:
Then inside the div editable do this:
Important here is to include the shouldValidate inside the onInput of the div contenteditable.