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

fix(quill): save empty string when content is empty #578

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/item/FolderDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ const FolderDescription: FC<Props> = ({ itemId, isEditing = false }) => {
const { data: parentItem } = hooks.useItem(itemId);

const onDescriptionSave = (str: string) => {
editItem({ id: itemId, description: str });
let description = str;
// check that the content is just empty
// this is added by quills internal model based on deltas https://quilljs.com/docs/delta/
if (str === '<p><br></p>') {
description = '';
}
editItem({ id: itemId, description });
setEditingItemId(null);
};

Expand Down