I am trying on get oninput or onchange handlers working with contenteditable. My code is as below:
<p contenteditable="true" oninput="@HandleChange" onchange="@HandleChange">@Text</p>
@functions{
[Parameter] string Text{get;set;}
void HandleChange(UIChangeEventArgs e)
{
Console.WriteLine(e.Type + " " + e.Value);
}
}
In above code e.Value is always null.
I should note that it works well with input and bind. But i need this to work for a p and div. I need the value as string, however it would be nice to get the value as html (innerHTML) as well.
Any solution, please?
I am trying on get oninput or onchange handlers working with
contenteditable. My code is as below:In above code
e.Valueis alwaysnull.I should note that it works well with
inputandbind. But i need this to work for apanddiv. I need the value as string, however it would be nice to get the value as html (innerHTML) as well.Any solution, please?