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

chore: Refactor tiptap events #10800

Merged
merged 5 commits into from
Feb 5, 2025
Merged

chore: Refactor tiptap events #10800

merged 5 commits into from
Feb 5, 2025

Conversation

mattkrick
Copy link
Member

Description

I really didn't like the leaky abstraction I originally built where linkState was created by the parent Component & passed to useEditor and then TipTapEditor.

This fixes it by using the event emitter built into the editor. Keeps everything modular and cleeeean.

Also adds underlines to the bubble menu

@github-actions github-actions bot added the size/m label Feb 5, 2025
Signed-off-by: Matt Krick <[email protected]>
@mattkrick mattkrick merged commit 4383430 into master Feb 5, 2025
6 checks passed
@mattkrick mattkrick deleted the tip-tap-emitters branch February 5, 2025 23:50
Copy link

sentry-io bot commented Feb 6, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SyntaxError: "undefined" is not valid JSON JSON.parse(<anonymous>) View Issue
  • ‼️ Error: Rendered more hooks than during the previous render. RemoteReflection(packages/client/components/Ref... View Issue
  • ‼️ Error: Rendered more hooks than during the previous render. RemoteReflection(packages/client/components/Ref... View Issue

Did you find this useful? React with a 👍 or 👎

setLinkState={setLinkState}
useLinkEditor={() => useTaskChild('editor-link-changer')}
/>
<TipTapEditor editor={editor} useLinkEditor={() => useTaskChild('editor-link-changer')} />
Copy link
Contributor

Choose a reason for hiding this comment

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

@mattkrick We get linter warnings for this one because we pass hooks in a callback. I think it should work if we're careful, but it seems to be not a good idea and not a pattern I would like to keep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants