UniqueID extension adds extra empty paragraphs when used with HocusPocus
See original GitHub issueWhat’s the bug you are facing?
If the UniqueId
extension (2.0.0-beta.11
) is enabled with collaborative editing (via HocusPocus), TipTap adds an empty paragraph (sometimes in different locations) on every page reload.
How can we reproduce the bug on our side?
TipTap editor setup:
export const Tiptap = () => {
const websocketProvider = useMemo(() => new HocuspocusProvider({
url: 'ws://localhost:1234',
name: 'unique-id-test-01',
}), []);
const editor = useEditor({
extensions: [
StarterKit.configure({
history: false
}),
UniqueID.configure({
types: ['paragraph'],
// seems to happen with any filterTransaction,
// whether returning true or false
filterTransaction: isChangeOrigin,
}),
Collaboration.configure({
document: websocketProvider.document,
}),
],
}, [websocketProvider]);
return (
<div style={{ border: '1px solid blue'}}>
<EditorContent editor={editor} />
</div>
);
};
HocusPocus setup:
const server = Server.configure({
port: 1234,
extensions: [
new RocksDB()
]
});
server.listen();
Steps to reproduce:
- open the app
- refresh the browser
- see that it added an empty paragraph
Can you provide a CodeSandbox?
No response
What did you expect to happen?
No empty paragraphs should be added.
Anything to add? (optional)
No response
Did you update your dependencies?
- Yes, I’ve updated my dependencies to use the latest version of all packages.
Are you sponsoring us?
- Yes, I’m a sponsor. 💖
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Gutenberg blocks editor enabled, empty paragraphs in code ...
Hi! There is a problem when Gutenberg editor enabled for popups in plugin's settings. There are paragraphs in the content that are empty...
Read more >Paragraph – Tiptap Editor
Without this extension you won't even be able to use paragraphs in the editor. ... Custom HTML attributes that should be added to...
Read more >Untitled
Blackpool planning app search, Pulse extender weidmuller, Olmstedville ny bakery, Linzer gugl games, Share bear music downloads free?
Read more >How to remove all empty paragraphs in Word? - ExtendOffice
The Find and Replace function in Word is commonly used as long as we know that empty paragraph symbol can be found as...
Read more >Empty paragraph killer | Drupal.org
Empty paragraph killer is a filter module, helpful on sites which use ... the paragraph spacing, so the extra empty paragraphs created can ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
oh stupid me 🤦♂️
filterTransaction: t => !isChangeOrigin(t)
is correct!I fixed it in the docs.
@philippkuehn @hanspagel I think the change made for this has some side-effects: when using collaboration/HocusPocus, the first paragraph you start on won’t have the attribute from UniqueId until you type at least one letter.