Skip to content

Commit

Permalink
fix(quill): save empty string when content is empty (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh authored Feb 28, 2023
1 parent 39c53d7 commit c62de5d
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit c62de5d

Please sign in to comment.