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

[SuperEditor] Fix missing default task component builder (Resolves #2048) #2051

Merged
merged 1 commit into from
May 28, 2024

Conversation

angelosilvestre
Copy link
Collaborator

[SuperEditor] Fix missing default task component builder. Resolves #2048

SuperEditor crashes with the default configuration if the content contains a task:

======== Exception caught by widgets library =======================================================
The following _Exception was thrown building _StandardEditor(state: _StandardEditorState#cb5c0):
Exception: Couldn't find styler to create component for document node: TaskNode

The reason is that we don't add the task component builder by default.

This PR adds a TaskComponentBuilder when the app uses the default component builders.

Additionally, we have an UnknownComponentBuilder to render unknown components, but it only creates the component, not the view model. As a result, any unknown node causes the editor to crash. I think that it's better to display a placeholder instead of crashing the editor if we find an unknown node. I modified the UnknownComponentBuilder to return a new view model instead of returning null. Since the UnknownComponentBuilder is always the last, this change shouldn't cause any issues, but I can remove this change if it's not desired.

Copy link
Contributor

@matthew-carroll matthew-carroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matthew-carroll matthew-carroll merged commit 0bb0d4d into main May 28, 2024
11 checks passed
@matthew-carroll matthew-carroll deleted the 2048_default-task-component-builder branch May 28, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SuperEditor] - Missing styles for tasks in default configuration
2 participants