dotnet/aspnetcore

Blazor: bind-value-oninput or bind does not work with contenteditable divs

Open

#9,974 创建于 2019年5月4日

在 GitHub 查看
 (24 评论) (69 反应) (2 负责人)C# (10,653 fork)batch import
Pillar: Complete Blazor WebPriority:2affected-fewarea-blazorenhancementfeature-blazor-component-modelfeature-razor.languagehelp wantedon-roadmapseverity-nice-to-have

仓库指标

Star
 (37,933 star)
PR 合并指标
 (平均合并 16天 9小时) (30 天内合并 258 个 PR)

描述

bind-value-oninput or bind does not work with contenteditable divs

Bug Description

In the below code, the expectation is as and when I edit the div content I need to update the model so that I can then save it back to Database.

To Reproduce

Steps to reproduce the behavior:

  1. Using the latest preview version of ASP.NET Core 3
  2. Run the below code <div contenteditable="true" bind-value-oninput="@contentEditableText"> You can Edit this Text </div> @contentEditableText @functions { string contentEditableText = "You can Edit this Text"; }
  3. As I Type something in the editable div, I need to see the same reflected in the body, but it does not happen that way. The OnChange event does not fire automatically.

Expected behavior

OnChange Event needs to fire and changes in editable div should be bound to the model.

Screenshots

贡献者指南