Skip to content

Contenteditable node renders the content twice #2502

@erikvullings

Description

@erikvullings

When creating a contenteditable element, as shown in this flems, the text is created twice (only on first render, not when updating the page).

The issue is, most likely, caused by the fact that the following source code function never returns true (i.e.. maybeSetContentEditable always returns undefined).

Mithril version: 2.0.3

Browser and OS: Tested on both chrome and Edge (developer), Windows 10

Code

const MyComponent = {
  view: () => m('div[contenteditable]', m.trust('<i>Hello, world</i>')),
};

m.render(document.body, m(MyComponent));

Expected Behavior

I should only see

<i>Hello, world</i>

and not

<i>Hello, world</i><i>Hello, world</i>

Metadata

Metadata

Assignees

Labels

Type: BugFor bugs and any other unexpected breakage

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions