Skip to content
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

Empty config.initialData is overwritten with data from DOM #8974

Closed
scofalik opened this issue Feb 2, 2021 · 0 comments · Fixed by #9337
Closed

Empty config.initialData is overwritten with data from DOM #8974

scofalik opened this issue Feb 2, 2021 · 0 comments · Fixed by #9337
Assignees
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:editor-balloon package:editor-classic package:editor-decoupled package:editor-inline squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@scofalik
Copy link
Contributor

scofalik commented Feb 2, 2021

📝 Provide detailed reproduction steps (if any)

To reproduce the error you need DOM element with some data and then create an editor on that DOM element and use initialData: '' in config.

In such configuration, I'd expect that the editor will be empty, but it actually is inited with the data from the DOM. That's because this code:

const initialData = config.initialData || getInitialData( sourceElementOrData );

return editor.data.init( initialData );

Which is incorrect. This code treats empty and unset initial data the same way.

@Mgsy Mgsy added domain:dx This issue reports a developer experience problem or possible improvement. squad:dx labels Feb 8, 2021
@scofalik scofalik added the squad:collaboration Issue to be handled by the Collaboration team. label Mar 2, 2021
@scofalik scofalik added this to the iteration 41 milestone Mar 2, 2021
@scofalik scofalik self-assigned this Mar 2, 2021
@Reinmar Reinmar modified the milestones: iteration 41, iteration 42 Mar 15, 2021
pomek added a commit that referenced this issue Mar 23, 2021
Fix: The editor was not initialized with the empty data for `config.initialData` set to an empty string. Closes #8974.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:editor-balloon package:editor-classic package:editor-decoupled package:editor-inline squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
3 participants